This content has been marked as final. Show 2 replies
in my QlikView application I need to upload data from txt/csv files (previously uploaded) and write them on a remote SQL Server DB using OLEDB driver.
Reading this forum I found the utilisation of ADO technology as unique solution, inserting it into a macro.
I tried to create a basic vbscript function to insert one record in db.
Here's my code:
dim sConn, oRS, sSQL
set sConn = CreateObject("ADODB.Connection")
url = "Provider=sqloledb;Data Source=server_name;Initial Catalog=db_name;UserId=xxxx;Password=xxxx"
set oRS =CreateObject("ADODB.Recordset")
sSQL="INSERT INTO STG.STG_PROVA_INSERT (FATTURA_RIGA_ID, FATTURA_ID, PRODOTTO_ID, CONTRATTO_ID, PUNTO_ID, VERSIONE_ID, NUMERO_FISCALE, RIGA_CD) VALUES (0,0,0,0,0,0,"","")"
oRS.Open sSQL, sConn, adOpenDynamic, adLockOptimistic, adCmdUnspecified
rem set oRS = sConn.execute(sSQL)
set oRS = Nothing
set sConn = Nothing
The execution fails with command "sConn.open url", I think because the compiler doesn't solve "CreateObject("ADODB.Connection")" call.
Any clues? Tips? Tricks? Would really appreciate it!
Thanks a lot,