
Why isn't my code working?
I don't know much about ADO, but before anyone can help you I think
you'd better tell us in what way your code "isn't working". Is there
a compile-time error? A run-time error? If there's an error, what is
the message? Do you get an unexpected/incorrect result? Do you not
get any result? These details would help.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
Quote:
> Can someone explain to me why this code isn't working? I am breaking
my head
> and can't move forward.
> Option Compare Database
> Sub testing()
> Dim myconn As ADODB.Connection
> Set myconn = New ADODB.Connection
> myconn.ConnectionString = "driver = {Microsoft Access Driver};" & _
"server=N15;uid=anitel;pwd=yisrael;database=callyisrael.com/fpdb/agent
s.mdb"
Quote:
> myconn.Open
> MsgBox "conn state: " & GetState(myconn.State)
> myconn.Close
> End Sub
> Public Function GetState(intState As Integer) As String
> Select Case intState
> Case adStateClosed
> GetState = "adStateClosed"
> Case adStateOpen
> GetState = "adStateOpen"
> End Select
> End Function