Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Connecting SQL tables to Access

Author  Topic 

abacus
Starting Member

6 Posts

Posted - 2007-10-11 : 13:52:26
I have been tinkering with connections to SQL Server 2000 from Access 2000 for a couple of days without much luck.

My most recent attempt is the following code to the click event of a command button on a form. Most of this code was acquired from other places on the net.

Dim oConn As ADODB.Connection

Set oConn = New ADODB.Connection
oConn.Open "Provider=sqloledb;" & _
"Data Source=Hed001;" & _
"Initial Catalog=My_Views;" & _
"User Id=;vel007" & _
"Password=driver"

Dim oRS As ADODB.Recordset
Set oRS = New ADODB.Recordset

oRS.Open "Select * from VOrder_Header", oConn


Amazingly, it does not error out. But what do I do next to see the records in VOrder_Header?

Just a newb blazing at trail here in the unknown...

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-10-12 : 02:10:28
Do until ors.bof or ors.eof
debug.print ors.fields(1)
ors.movenext
loop



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -