forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


vdsdll - vdsdb

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
DoT_PiTcH
Contributor
Contributor


Joined: 07 Aug 2002
Posts: 85

PostPosted: Tue Jan 17, 2012 3:28 pm    Post subject: vdsdll - vdsdb Reply with quote

Ok this doesnt work on x64 system.


(Local Hard Drive):\WINDOWS\SysWOW64\odbcad32.ex

i manually made dsn in x86 but still vdsdb example errors out when ran.
does anyone know if there is a way around this. i will be developing on x64 and this will deployed on x86 system. but if i cant fix this i wont buy the dll
Back to top
View user's profile Send private message Visit poster's website
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Thu Jan 19, 2012 3:09 am    Post subject: Reply with quote

Works for me on Win 7 x64 and Server 2008 R2

Consider the following code in lue of using odbc32.exe on a 64bit Windows system.
Code:
#  %%DSN = Connection Name
#  %%UID = User Name that can access the DB or DBQ

#  IF SQL
#   %%DBDescr = What this connection is for
#   %%DBServer = SQL Server name
#   %%DBName = Name of DB on SQL Server
#  IF MS Access
#   %%DBQ = Full path to Access file



#  Use for SQL Server
 runh reg add HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN /v Driver /t REG_SZ /d @windir(S)\sqlsrv32.dll /f
 runh reg add HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN /v Description /t REG_SZ /d %%DBDescr /f
 runh reg add HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN /v Server /t REG_SZ /d %%DBserver /f
 runh reg add HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN /v Database /t REG_SZ /d %%DBName /f
 runh reg add HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN /v Regional /t REG_SZ /d No /f
 runh reg add HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN /v Trusted_Connection /t REG_SZ /d No /f
 runh reg add HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN /v LastUser /t REG_SZ /d %%UID /f
 runh reg add @chr(34)HKLM\Software\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources@chr(34) /v %%DSN /t REG_SZ /d @chr(34)SQL Server@chr(34) /f
 
#  Use for MS Access
 runh reg add HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN /v Driver /t REG_SZ /d @windir(S)\odbcjt32.dll /f             
 runh reg add HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN /v DBQ /t REG_SZ /d %%DBQ /f
 runh reg add HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN /v DriverId /t REG_DWORD /d 00000000 /f
 runh reg add HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN /v SafeTransactions /t REG_DWORD /d %%DBName /f
 runh reg add HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN /v UID /t REG_SZ /d %%UID /f
 runh reg add HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN\Engines
 runh reg add HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN\Engines\Jet /v Threads /t REG_DWORD /d 00000003 /f
 runh reg add HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN\Engines\Jet /v UserCommitSync /t REG_SZ /d Yes /f
 runh reg add @chr(34)HKLM\Software\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources@chr(34) /v %%DSN /t REG_SZ /d @chr(34)"Microsoft Access Driver (*.mdb)"@chr(34) /f

#  Now you should be able to connect to your DB
#  If using vdsdb.dll
db connect,%%DSN,%%UID,%%PWD
# or if using all-in-one vdsdll.dll
dll db,connect,%%DSN,%%UID,%%PWD

I know this can be done using the VDS command "Registry Write" but when I originally developed this it was for remote registry purposes i.e
Code:
runh reg add \\%%ComputerName\HKLM\Software\Wow6432Node\ODBC\ODBC.INI\%%DSN /v Driver /t REG_SZ /d @windir(S)\sqlsrv32.dll /f


Hope this was some help to you Smile
I use the vdsdb.dll extensively so feel free PM me if you need assistance
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group