Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

help me connecting to sqlserver

I'm trying connecting to SQLSERVER to insert data into a table.

The following script is attached to a button.

When I press the button the script page is open letting me know the script is not doing anything because of a error.

the connection string is not working here but if I use it in the loading script it works correctly.

can somebody help me?

sub testSomeButtons

dim sConn, oConn

rem Set oConn = Nothing

Set oConn = CreateObject("ADODB.Connection")

sConn = "Provider=SQLOLEDB.1;Data Source=xxxxxxxx;Initial Catalog=xxxxxxx;User Id=xxxxxxxx;(XPassword is XXXXXXXXXXXX);"

oConn.Open sConn

rem sSQL="INSERT INTO [dbo].[mydb] ([text]) VALUES ('pippo')"

rem oConn.Execute(sSQL)

rem oConn.Close

rem Set oConn = Nothing

msgbox("It's allright")

end sub

2 Replies
Not applicable
Author

my fault. found the error so the problem is solved.

Anonymous
Not applicable
Author

Hi Mauro,

We're glad to see you were able to find the error. If you can, please post a short explanation of how you resolved this so that it may help others who have the same error.

Thank you,

Qlik Community Team