From: Sue on
I have the following code: - the code runs well, I get a message
saying connection is open, but when I try to run the make table query
I still get the login prompt - how do I avoid the login prompt?

Many thanks!


Dim qryArch112 As String
qryArch112 = ""

qryArch112 = "select DBOBJECTS_UDWEBFORMS_ARCHFRM_112_VIEW.PROPOSAL
INTO tblArch112 FROM DBOBJECTS_UDWEBFORMS_ARCHFRM_112_VIEW;"

'---open UD01
Dim oConn3 As ADODB.Connection
Set oConn3 = New ADODB.Connection

Dim sr As String
sr = "pr01"

If (udun <> "" And udpwd <> "") Then
oConn3.Open "Driver={Microsoft ODBC for Oracle};" & _
"Server=UD01.world;" & _
"Uid=asere;" & _
"Pwd=0145"

End If

If oConn3.State=adStateOpen then
msgbox "open"

DoCmd.SetWarnings False
DoCmd.RunSQL qryArch112
DoCmd.SetWarnings True

end if


If oConn3.State = adStateOpen Then
oConn3.Close
Set oConn3 = Nothing
End If
From: MikeD on


"Sue" <sea_099(a)hotmail.com> wrote in message
news:d15a0889-62f7-4057-a061-57aa459de1a4(a)a21g2000yqc.googlegroups.com...
>
> DoCmd.SetWarnings False
> DoCmd.RunSQL qryArch112
> DoCmd.SetWarnings True
>

You're probably better off asking this in an Access newsgroup.

--
Mike


From: Paul Clement on
On Tue, 8 Dec 2009 14:50:23 -0800 (PST), Sue <sea_099(a)hotmail.com> wrote:

� I have the following code: - the code runs well, I get a message
� saying connection is open, but when I try to run the make table query
� I still get the login prompt - how do I avoid the login prompt?

You could be getting the login prompt because you don't have sufficient permissions to the Oracle
objects you are referencing.

In addition, do not use persistent connections. Open a connection, do your database business and
then close the connection.


Paul
~~~~
Microsoft MVP (Visual Basic)