By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,466 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,466 IT Pros & Developers. It's quick & easy.

ODBC call-failed error

P: n/a
I have quite a few Oracle linked tables into my Access(97) database.
But when you want to open a table get a pop window to enter Username,
Password and Server. What I am trying to do is put some code on the
open event of the startup form that sets this up so that you don't get
the popup connect window.

I am having problem getting it working. Keep getting ODBC call-faile
error when i am trying to use the driver Oracle73 ver2.5.

Can anyone please help.

Thanks

ishabir
-------------------
Private Sub Form_Load()
Global_Username = "ishabir"
Global_Password = "ishabir_0"
Global_ODBC_Connect = "ODBC;DSN=MIS;UID=" & Global_Username & ";PWD="
& Global_Password & ";SERVER=MISDB;"
'Create a datasource based on the username.
Dim strAttributes As String
strAttributes = "Description=Access Logon to MIS." & _
vbCr & "UID=" & Global_Username & _
vbCr & "Server=MISDB"

DBEngine.RegisterDatabase "mis", "Oracle73 ver2.5", True,
strAttributes

End Sub
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You don't need to use the RegisterDatabase method. The usual method
of "preconnection" avoids user & password requests. Here is a routine
from the boot _Building Applications with Microsoft Access 97_ (it
applies to all ODBC connections).

Sub PreConnect (strUserName As String, strPassword As String)
Dim wrkRemote As Workspace, dbsRemote As Database
Dim strConnect As String

strConnect = "ODBC;DSN=MyServer;DATABASE=MyDatabase;" & _
"UID=" & strUserName & "PWD=" & strPassword & ";"
Set wrkRemote = DBEngine.Workspaces(0)
Set dbsRemote = wrkRemote.OpenDatabase("", False, False, strConnect)
dbsRemote.Close ' Close database but keep connection.
End Sub

Run this routine when you first open your application. Any requests
after this will not request the user name & password.

HTH,

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP9oqxIechKqOuFEgEQJSxACgoB/ElCKP4QJw9SsNxl184wYtV48AnAzX
Dx40NCIVCrnw0Hk9wM5E0/ir
=tueL
-----END PGP SIGNATURE-----

ishabir wrote:
I have quite a few Oracle linked tables into my Access(97) database.
But when you want to open a table get a pop window to enter Username,
Password and Server. What I am trying to do is put some code on the
open event of the startup form that sets this up so that you don't get
the popup connect window.

I am having problem getting it working. Keep getting ODBC call-faile
error when i am trying to use the driver Oracle73 ver2.5.

Can anyone please help.

Thanks

ishabir
-------------------
Private Sub Form_Load()
Global_Username = "ishabir"
Global_Password = "ishabir_0"
Global_ODBC_Connect = "ODBC;DSN=MIS;UID=" & Global_Username & ";PWD="
& Global_Password & ";SERVER=MISDB;"
'Create a datasource based on the username.
Dim strAttributes As String
strAttributes = "Description=Access Logon to MIS." & _
vbCr & "UID=" & Global_Username & _
vbCr & "Server=MISDB"

DBEngine.RegisterDatabase "mis", "Oracle73 ver2.5", True,
strAttributes

End Sub


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.