Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open ODBC Connection

Status
Not open for further replies.

richmiester

IS-IT--Management
Nov 13, 2002
4
US
Hi all... I'm looking for the code to open a passworded ODBC connection. I have a series of queries scripted and my problem is that when each query finishes the connection is closed then the password box pops up before the next one can run. Any ideas? The connection has its own alias.
 
You can add the password to the connect string:

DSN=data_source_name[;attribute=value[;attribute=value]...]
DSN=PARADOX TABLES;DB=C:\ODBC\EMP;PW=ABC,DEF,GHI

Where PW is Password and DB is the directory to the tables.

Regan
 
I use the following code to connect to an Open Link Generic 32 BIT ODBC Server without the password dialog box being displayed. I can then query that server without problems.

var
AliasInfo DynArray[] String
endVar

AliasInfo["SERVER NAME"] = ""
AliasInfo["USER NAME"] = ""
AliasInfo["OPEN MODE"] = "READ ONLY"
AliasInfo["PASSWORD"] = ""

if NOT addAlias("LIVE", "OpenLink Generic 32 Bit Driver", AliasInfo) then
return
endIf

setAliasPassword ("LIVE", " ")

The <space> for the password seems to be important, if you just put &quot;&quot; the dialog box appears.[surprise]

Hope that is of help

Steve [afro2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top