Thread: VB and ADO

VB and ADO

From
"Santiago"
Date:
Hi !!!!.
I have some problem with the connection ADO and Visual Basic.
 
please help me
 
This is my code
 
dim conecction as new connection
dim rstable as new recorset
sub main
    set conecction = createobject("ADODB".conecction)
    connection.open "dsn=kion"
end sub   
 
When find in the ODBC kion, this is a problem
With DAO function very good.
 
ja, Sorry for my english !!! I speak spanish :)
 
 
 
 
 
 

RE: VB and ADO

From
Dave Page
Date:
> -----Original Message-----
> From: Santiago [mailto:santiago@bci.com.ar]
> Sent: 26 August 2000 02:03
> To: pgsql-interfaces@postgresql.org
> Subject: [INTERFACES] VB and ADO
>
>
> Hi !!!!.
> I have some problem with the connection ADO and Visual Basic.
>
> please help me
>
> This is my code

> dim conecction as new connection
> dim rstable as new recorset
> sub main
>    set conecction = createobject("ADODB".conecction)
>     connection.open "dsn=kion"
> end sub   

> When find in the ODBC kion, this is a problem
> With DAO function very good.

> ja, Sorry for my english !!! I speak spanish :)

Try something like (you can lose the ADODB. 's if you only reference ADO in
your project):

Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset

Sub Main cn.Open "DSN=kion" rs.Open "SELECT * FROM pg_class", cn
End Sub

Regards,  
Dave.  
-- 
Disclaimer: the above is the author's personal opinion and is not the
opinion or policy of his employer or of the little green men that have been
following him all day.
http://www.vale-housing.co.uk/ - http://www.pgadmin.freeserve.co.uk/