Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Writing back to database

Hello All,

I need to insert data from qlikview into sql database.

Have written the below macro.

But it does not work.

What is the problem with the macro.

Sub Insert_Comment


Dim objADO


Dim objRs


Dim strSQL

vName=ActiveDocument.GetVariable("vName").GetContent.String


Set objADO = CreateObject("ADODB.Connection")


objADO.Open "Provider=Mysql ODBC 5.1 Driver;Data Source=testsql;User ID=cNXWPZdNPDdQN;Password=cMKEGZdNPDdWO;"


strSQL="insert into EMPLOYEE values(‘"&vName&"‘)"


objADO.BeginTrans


objADO.Execute strSQL


objADO.CommitTrans


objADO.Close


Msgbox("Comment Updated")


End Sub

Thanks and Regards,

Priya

2 Replies
arieidel
Partner - Creator II
Partner - Creator II

Hi,

Perhaps you can solve the problem looking at this post:

http://community.qlik.com/message/135858#135858

Bill_Britt
Former Employee
Former Employee

Hi,

I think Ariel reply should help you out. I just had to add to the post. When I first started with QlikView I as the question about writing back and the answer I got at first was "This is QlikView and not QlikWrite". Then they told me how to do it.

Bill

Bill - Principal Technical Support Engineer at Qlik
To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.