Why isn't my code working? 
Author Message
 Why isn't my code working?

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/agents.mdb"
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



Tue, 09 Aug 2005 00:01:25 GMT  
 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



Tue, 09 Aug 2005 04:54:37 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. why isn't this api code working?

2. Why isn't any API code working

3. Why isn't my filter working in the Common Dialog ShowOpen Function

4. why isn't this api working?

5. Why Isn't MyBase.New() Working Here?

6. Why isn't this working??

7. Why isn't this working?

8. why isn't this working?

9. Why isn't this working

10. why isn't this working

11. Why isn't his working correctly...?

12. Why isn't this working?

 

 
Powered by phpBB® Forum Software