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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6, ODBC and Word(97)

Status
Not open for further replies.

stevin

Programmer
Aug 24, 2001
1
NL

Hi VBers,

Am I crazy or what? The following problem persists and I really do not know what is going on and how to solve it.

My VB6-application connects to a Oracle 7.3 database with the following Connectstring

Global cn As ADODB.Connection
Set cn = New ADODB.Connection
cConn = "UID=userID;PWD=passw;DRIVER={Microsoft ODBC for Oracle};SERVER=OraSRV;"
cn.Open cConn

So, here we use the Microsoft ODBC-driver. And everything works fine.. This connection stays open during the complete session.

On request the VB-application calls the MSofice-Word97 application with a template-name in which a macro is defined. This macro is then started in order to print a letter. This macro connects to the same Oracle Database but with the Oracle ODBC-driver. UserID and Password are read from the VB-screen thru DDE.

Global conWMT As DATABASE
cConn =
"ODBC;DATABASE=OraDB;UID=UserID;PWD=Passwd;DSN=OraDSN"
Set conWMT = DBEngine.Workspaces(0).OpenDatabase("",
dbDriverComplete, True, cConn)

So, here we use the Oracle ODBC-driver. And everything works fine... Everytime a letter is requested the connection is established and closed when done:
conWMT.Close
Set conWMT = Nothing.

And now it comes:
There is an option in the VB-aplication to change the Oracle-user-password. (this is done with the Oracle Alter-statement). The VB-appl continues to run fine.
The Word-macro receives the new password and builds a new connectionstring that looks OK (with new password).
But when making the connection (Set conWMT) an Oracle LogOn screen appears (because of the dbDriverComplete) and the old password needs to be replaced by the new one.
So it is trying to connect with the old one!! Only after restarting the VB-appl everything is synchronized as it should be.

How come?? Is there anyone who experienced this also?
And are there any suggestions??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top