Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords:
request=2;ODBC_CONFIG_DSN driver="Microsoft Access Driver (*.mdb)"; attrs = 'COMPACT_DB="' : databasename : '" "' : databasename : '" General' displayflag=@FALSE ret=qConfigData(request, driver, attrs, displayflag) Message("qConfigData - Created DSN",ret) qFreeConnect(hdbc) qFreeEnv(henv)My problem is the attrs gets too large, presumably because the network path is 153 characters (which is repeated). Any thoughts of getting around this?
Here is a workaround to the limitation in the qConfigData attributes parameter:
; Types of operations that can be performed ODBC_ADD_DSN =1 ; Add data source ODBC_CONFIG_DSN =2 ; Configure (edit) data source ODBC_REMOVE_DSN =3 ; Remove data source ODBC_ADD_SYS_DSN =4 ; add a system DSN ODBC_CONFIG_SYS_DSN =5 ; Configure a system DSN ODBC_REMOVE_SYS_DSN =6 ; remove a system DSN ; Return Codes SQL_FALSE = 0 SQL_TRUE = 1 databasename = 'D:\temp\Data\zipcodes.mdb' strDriver = 'Microsoft Access Driver (*.mdb)' strAttr = 'COMPACT_DB="' : databasename : '" "' : databasename : '" General' obdcdll = DirWindows(1):"ODBCCP32.DLL" ret = DllCall( obdcdll, long:"SQLConfigDataSource", long:0, long:ODBC_CONFIG_DSN, lpstr:strDriver, lpstr:strAttr ) If ret <> SQL_TRUE Message( "SQL FAILED", ret ) EndIf Pause('Compact','Successful') Exit
Article ID: W17583
Filename: 521 Attribute string too long.txt
File Created: 2012:11:26:09:50:54
Last Updated: 2012:11:26:09:50:54