Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO connection to Recordset

Status
Not open for further replies.

MJPPaba

MIS
May 28, 2003
142
GB
Hi All,

Im fairly new to Sybase but reasonably familiar with SQL and competent with Access etc.

My problem is this, I have an sybase warehouse and an access client end database.

my code is...

Dim myCnn As ADODB.Connection
Dim myRST As ADODB.Recordset

mySQL = "SELECT * "
mySQL = mySQL & "From myTable "

Set myCnn = New ADODB.Connection

myCnn.Open "driver={SYBASE SYSTEM 11};srvr=mySvr;database=myDbase;uid=myUserID;pwd=myPwd"

Set myRST = New ADODB.Recordset

myRST.Open mySQL, myCnn

MsgBox myRST.RecordCount

myCnn.Close

Set myCnn = Nothing



result are -1 in the msgbox.

where am I going wrong?

Cheers

Matt
 
the record count on the record set object is not reliable, and it depends on the driver used, the type of cursor used (Client side is a must for it to work), and eventually on other things related to both the connection and the recordset object.

If you only need the count then you should change the SQL to do just that. Otherwise you will need to revise your object properties, and try it out until if find the correct settings, but bear in mind it may not be possible depending on your driver. (unless you loop through the whole recordset!!)

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 


Hi,

You could also LINK the Sybase table into your Access database. Then it will act like any other table when you query.

Skip,

[glasses] [red][/red]
[tongue]
 
Hi Skip,

Unfortunately, I had to resort to doing this course of action.

Thanks old friend,

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top