I have used file DSN in the past now you mention it. I could maybe create a file DSN to the mdf files that are created by SQL Express perhaps?
I dug out this old code for creating a ODBC DSN in windows from an mdb file livecode...
Code: Select all
function createConnection theFile
replace "/" with "\\" in theFile
if "\\" is not in theFile then replace "\" with "\\" in theFile
local regResult
get setRegistry("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\Database\Driver","C:\\WINDOWS\\system32\\odbcjt32.dll")
get setRegistry("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\Database\DBQ",theFile)
get setRegistry("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ Database\DriverId",binaryEncode("I",0),"dword")
get setRegistry("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ Database\FIL","MS Access;")
get setRegistry("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ Database\SafeTransactions",binaryEncode("I",0),"dword")
get setRegistry("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ Database\UID","")
get setRegistry("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ Database\Engines\Jet\ImplicitCommitSync","")
get setRegistry("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ Database\Engines\Jet\MaxBufferSize",binaryEncode("I",2048),"dword")
get setRegistry("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ Database\Engines\Jet\PageTimeout",binaryEncode("I",5),"dword")
get setRegistry("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ Database\Engines\Jet\Threads",binaryEncode("I",3),"dword")
get setRegistry("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ Database\Engines\Jet\UserCommitSync","Yes")
get setRegistry("HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources\ Database","Microsoft Access Driver (*.mdb)")
if gConnectionID is number then
revCloseDatabase(gConnectionID)
put empty into gConnectionID
end if
get revOpenDatabase("odbc","Database", , , ,)
return it
end createConnection
I might try modifying this to read the mdf