Avatar billede funkyloonie Nybegynder
22. marts 2003 - 11:11 Der er 6 kommentarer og
1 løsning

Registrere ODBC streng ved installation

Jeg er igang med at lave en insttalationsfil vha. installanywhere og har brig for at vide hvordan man kan registrere sin ODBC-database til systemet så programmet kan finde databasen uden at man selv skal sætte registrere odbc-databasen? Det er udelukkende til windows.
Avatar billede terry Ekspert
22. marts 2003 - 11:38 #1
Not 100% sure I understand what it is your after so I am just guessing.
The information to ODBC data sources is saved in the registry and can be exported to a .reg file which can be used to "automate" th etask of setting up an ODBC data source.
Avatar billede terry Ekspert
22. marts 2003 - 11:41 #2
IF this is what you want then first you need to set up the ODBC connection on one PC and then export the information from the registry.
I assume that you know how to set up the ODBC and also open the registry.

You will actually need to export two registry keys and then make one single file which will look like this (this is for a MS SQL Server dB)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]
"test"="SQL Server"

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\test]
"Driver"="C:\\WINDOWS\\SYSTEM32\\SQLSRV32.DLL"
"Description"="test of SQL 2000 from XP"
"Server"="(local)"
"LastUser"="TS"
"Trusted_Connection"="Yes"
"Database"="testDB"
Avatar billede funkyloonie Nybegynder
22. marts 2003 - 14:11 #3
I get this information in the regfile:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\AutoMan]
"Driver"="C:\\WINNT\\System32\\odbcjt32.dll"
"DBQ"="E:\\Java\\AutoMana\\database\\AutoMana.mdb"
"Description"="Auto"
"DriverId"=dword:00000019
"FIL"="MS Access;"
"SafeTransactions"=dword:00000000
"UID"=""

[HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\AutoManager\Engines]

[HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\AutoManager\Engines\Jet]
"ImplicitCommitSync"=""
"MaxBufferSize"=dword:00000800
"PageTimeout"=dword:00000005
"Threads"=dword:00000003
"UserCommitSync"="Yes"
Avatar billede funkyloonie Nybegynder
22. marts 2003 - 14:12 #4
I will try to use the reg-file. Is some of the information unnessesary ?
Avatar billede terry Ekspert
22. marts 2003 - 14:38 #5
There should also be a key
[HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]

ths will contain a line for all sources so you need to only take the one line for yours
It will look like this I would think
[HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]
AutoMan"="Microsoft Access Driver (*.mdb)"

then copy it all into one file
and I would think it would look like this.

[HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]
AutoMan"="Microsoft Access Driver (*.mdb)"

HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\AutoMan]
"Driver"="C:\\WINNT\\System32\\odbcjt32.dll"
"DBQ"="E:\\Java\\AutoMana\\database\\AutoMana.mdb"
"Description"="Auto"
"DriverId"=dword:00000019
"FIL"="MS Access;"
"SafeTransactions"=dword:00000000
"UID"=""

[HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\AutoManager\Engines]

[HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\AutoManager\Engines\Jet]
"ImplicitCommitSync"=""
"MaxBufferSize"=dword:00000800
"PageTimeout"=dword:00000005
"Threads"=dword:00000003
"UserCommitSync"="Yes"
Avatar billede funkyloonie Nybegynder
23. marts 2003 - 16:38 #6
Jeg fandt ud af at løse det til sidst. det er første gang jeg selv har arbejdet med reg-filer. tak for hjælpen.
Avatar billede terry Ekspert
23. marts 2003 - 17:32 #7
your welcome and selv tak :o)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester