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

Rewrite database Macro not working in IE and ok in QV Desktop

Hello,

We are facing a weird issue with our QV App. We need to insert one new record onto an mysql Table and the Macro is working fine when we test with the QV Desktop. The issue raises when we do the same test with IE (Server 11R2 - QV Webserver). It doesn't work.

Do you have any clue??

Here you are the macro procedure

sub Upload

dim sServer, sConn, oConn,oRS

sServer="127.0.0.1"

sConn="Driver=MySQL ODBC 5.3 ANSI Driver;SERVER=127.0.0.1;UID=root;DATABASE=bidw;PORT=3306"

Set oConn = CreateObject("ADODB.Connection")

oConn.Open sConn, "root"

Set oRS =CreateObject("ADODB.Recordset")

Set TableBox = ActiveDocument.GetSheetObject("TB01")

CellRect = ActiveDocument.GetApplication().GetEmptyRect()

CellRect.Top = 0

CellRect.Left = 0

CellRect.Width = TableBox.GetColumnCount

CellRect.Height = TableBox.GetRowCount

Set CellMatrix = TableBox.GetCells(CellRect)

For RowIter = 1 to CellRect.Height-1

  vDeptno = CellMatrix(RowIter)(0).Text

  vDeptname = CellMatrix(RowIter)(1).Text

sSQL = "insert into dept(deptno,dname) values ('"& vDeptno &"','"& vDeptname &"')"

'msgbox(sSQL)

ors.open sSQL, oconn

next

msg= "inserted " & CellRect.Height-1 & " rows"

msgbox(msg)

end sub

#------mysql script

#------create table dept-----------------------------

create table dept(

DEPTNO int(2) not null ,

DNAME varchar(14) ,

LOC varchar(13)

)engine=InnoDB  ;

insert into dept values(10,'ACCOUNTING','NEW YORK');

Thanks a lot

1 Reply
m_woolf
Master II
Master II

Service Account doesn't have the appropriate access to the database?