I am having some issues with writing back from a dashboard back into my database. I understand all the issues involved, but the business unit is really demanding the functionality for one of our dashboards, and are forcing my hand.
I am successful in doing a writeback via ODBC when I have the dashboard open on my desktop. However, it is not working when I do the same in Internet Explorer (we are using the IE plugin, if it helps). I created the ODBC driver on our QV server already, but maybe I configured something incorrectly? Any help or guidance is appreciated!
The error I receive is "Macro parse failed. Functionality was lost DBWriteBack Error: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application.
dim sConn, oConn
Set oConn = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
sConn = "dsn=test;Uid=Test;Pwd=Test;"
for i=0 to val.Count-1
SQL_Str = "INSERT INTO QVTable (Team1, Team2) VALUES ('" & val.Item(i).Text & "', '" & val2.Item(i).Text & "')"
objRecordSet.Open "INSERT INTO QVTable (Team1, Team2) VALUES ('Team1_05','Team2_05')",oConn
Set oConn = Nothing
Thank you for the quick reply, but I still need some more guidance as I do not see how this solves my issue. The test connection works fine when I try to test it, and I have the ODBC set up as both 32 and 64 bit (and have tried deleting one and the other both to see if that would work as well). What is referenced in the link you provided seems to also be slightly different, since I believe the link references the load script and what I am trying to do is via a macro. Any more thoughts on things I can try?
Hi Ilya. If I understand correctly, then it's not be possible to write data back straight from access point. First you have to save it to the server (with ServerSideExportEx) and then write to the database.
I think there is not much difference if a database is accessed from the script or from the macro - in both cases it's needed that the right driver is called and a proper sql-statement is transferred from the execution-tool over the driver to the database.
If you are executing this macro within the access point in the IE plugin it will be called from this local user and the local machine and not from the server environment. This means the driver must be installed on the local machine and the user/network needs the proper access rights to the database.
I am trying to understand the driver point you have made several times now. I have the 13.0 Microsoft SQL server driver installed an am using it on my desktop. When I test the web version via the IE plugin, I am using the same exact driver.
Andrey seems to be giving me a different answer saying it is not possible to write back via Access Point. Trying to understand the right recommended approach for this. I can investigate the ServerSideExportEx approach that is mentioned, but any more guidance is appreciated.
Hi, Ilya. As I said you export a chart to the server via macro. Here's mine
var vChart = ActiveDocument.GetSheetObject("CH00")
vChart.ServerSideExportEx( "C:\\QlikView\\XLS\\XlsFile.xls", ";", 5 ) //0=HTML, 1=Text, 2=Bitmap, 3=XML, 4=QVD, 5=BIFF
Dim strDrive, strDir, strExt, strAction, WMIService, Events, ReceivedEvent, XLString, Email, ExcelFile, Subject
strDrive = "c:"
strDir = "\\QlikView\\XLS\\"
strExt = "xls"
strAction = " "
Set WMIService = GetObject("winmgmts:\\.\root\CIMv2")
Set Events = WMIService.ExecNotificationQuery _
("SELECT * FROM __InstanceOperationEvent WITHIN 5 WHERE " & _
"TargetInstance ISA 'CIM_DataFile'" & _
" AND TargetInstance.Extension = '" & strExt & "'" & _
" AND TargetInstance.Drive = '" & strDrive & "'" & _
" AND TargetInstance.Path = '" & strDir & "'")
Set ReceivedEvent = Events.NextEvent
Select Case ReceivedEvent.Path_.Class
Case "__InstanceCreationEvent": strAction = "Creation"
Case "__InstanceDeletionEvent": strAction = "Deletion"
Case "__InstanceModificationEvent": strAction = "Modification"
If (strAction = "Creation" or strAction = "Modification") Then
If I understand you right than you tried it with the desktop client and the IE plugin on the same machine - is it also the same user? This meant the same drivers are available but you don't specify a certain driver within your macro and therefore it might fail: Accessing Data with ADO.
Further you need to check if any macro is executed within the IE plugin - a simple msgbox should show it (and using a few of them with err.number and err.description will be quite helpful to find the error) and the export of any object to excel/csv will show if it has also system-access.
Also you should look if the IE traffic goes over any proxy-server and disable it for the test. Further try at first a read-access to the database and not a write-access.