phpbar.de logo

Mailinglisten-Archive

myODBC/DSN's: Installation vereinfachen/automatisieren - wie?

myODBC/DSN's: Installation vereinfachen/automatisieren - wie?

mysql-de_(at)_lists.bttr.org mysql-de_(at)_lists.bttr.org
Wed, 18 Sep 2002 15:19:16 +0200


Hi,


>
>Daher meine Frage: kann man das irgendwie automatisieren, speziell die 
>Eingaben im ODBC-Administrationsprogramm? Meine Idealvorstellung wäre, daß 
>auf Doppelklick irgendein Skript/Batchfile abläuft, und auf dem jeweiligen 
>Rechner alle Einstellungen vornimmt.
>

Ja, mit dem Programm ODBCCONF.EXE. Sollte im Verzeichnis \Windows\System32 liegen. Dazu macht man ein Script, z.B.  
install.bat zum Installieren der Treiber:

copy myodbc3.dll %windir%\system32\myodbc3.dll
copy myodbc3.lib %windir%\system32\myodbc3.lib
copy myodbc3d.dll %windir%\system32\myodbc3d.dll
copy my3dsn.hlp %windir%\help\my3dsn.hlp
copy myodbc3.rsp %windir%\system32\myodbc3.rsp
copy ODBCCONF.EXE %windir%\system32\ODBCCONF.EXE

ODBCCONF.EXE /f "%windir%\system32\myodbc3.rsp"

------------------ Ende Install.bat

ODBCCONF.EXE ruft ein Script (myodbc3.rsp) zum Installieren des DSN auf:

INSTALLDRIVER "MySQL ODBC 3.51 Driver|Driver=myodbc3.dll|Setup=myodbc3.dll||"
CONFIGDRIVER "MySQL ODBC 3.51 Driver" "APILevel=2" 
CONFIGDRIVER "MySQL ODBC 3.51 Driver" "ConnectFunctions=YYN" 
CONFIGDRIVER "MySQL ODBC 3.51 Driver" "DriverODBCVer=03.51"
CONFIGDRIVER "MySQL ODBC 3.51 Driver" "FileUsage=0" 
CONFIGDRIVER "MySQL ODBC 3.51 Driver" "FileExtns=*.txt" 
CONFIGDRIVER "MySQL ODBC 3.51 Driver" "SQLLevel=1" 
CONFIGDRIVER "MySQL ODBC 3.51 Driver" "CPTimeout=60"
CONFIGDRIVER "MySQL ODBC 3.51 Driver" "DSNHelpFile=C:\WINNT\help\my3dsn.hlp"
CONFIGSYSDSN "MySQL ODBC 3.51 Driver" "DSN=sample-MySQL;Description=MySQL ODBC 
Driver;SERVER=database_server;User=odbc;DB=test;Port=3306||"

------------------ Ende myodbc3.rsp

Hinter 'Port=3306' kann man auch noch 'Option=<Wert>' angeben wobei Wert die sich aus den gesetzten Bits der Optionen 
ergibt:

Bit	Meaning
1	If the client wants the real width of the column.
2 	The client can't handle that MySQL returns the true value of affected rows. If this flag is set then MySQL returns 
'found rows' instead. One must have MySQL 3.21.14 or newer to get this to work. 
4 	Make a debug log in c:\myodbc.log. This is the same as putting MYSQL_DEBUG=d:t:O,c::\myodbc.log in 
`AUTOEXEC.BAT'  - – Enabled only in debug mode
8	Don’t set any packet limit for results and parameters
16 	Don't prompt for questions even if driver would like to prompt 
32 	Enable or disable the dynamic cursor support. This is not allowed in MyODBC. 
64	Ignore use of database name in ‘database.table.column’.
128 	Force use of ODBC manager cursors (experimental). 
256 	Disable the use of extended fetch (experimental) 
512 	Pad CHAR fields to full column length. 
1024 	SQLDescribeCol () will return fully qualified column names 
2048 	Use the compressed server/client protocol 
4096 	Tell server to ignore space after function name and before '(' (needed by PowerBuilder). This will make all function 
names keywords! 
8192 	Connect with named pipes to a mysqld server running on NT. 
16384 	Change LONGLONG columns to INT columns (Some applications can't handle LONGLONG). 
32768 	Return 'user' as Table qualifier and Table owner from SQLTables (experimental) 
65536 	Read parameters from the client and odbc groups from `my.cnf' 
131072 	Add some extra safety checks (should not bee needed but...) 
262144	Disable transactions
524288	Write all queries to `c:\myodbc.sql` (`/tmp/myodbc.sql`) – Enabled only in debug mode


Viel Spaß. 

Bernd

---
Infos zur Mailingliste, zur Teilnahme und zum An- und Abmelden unter
-->>  http://www.4t2.com/mysql 



php::bar PHP Wiki   -   Listenarchive