8
8-bit
Hi all,
I'm fairly new to this so if I don't make sense I apologise. I'm
trying to use the Command object to access a Access DB from Excel - as
per the code below in my PS.
My problem is this: I need the RecordCount property - so I need to
change the CursorType - to adOpenStatic? Do I somehow tell Command or
RecSet?
Everything else works - but the .RecordCount returns -1 which my book
says is the default. I need to know if there are any records in the
recordset.
Any help would be appreciated.
Regards,
8-bit
PS. This is my code...
Set oCmd = New ADODB.Command
oCmd.ActiveConnection = oConn
sSQL = "SELECT * FROM table; "
oCmd.CommandType = adCmdText
oCmd.CommandText = sSQL
Set RecSet = oCmd.Execute
PPS. Please reply to group as the email I've used is bogus.
I'm fairly new to this so if I don't make sense I apologise. I'm
trying to use the Command object to access a Access DB from Excel - as
per the code below in my PS.
My problem is this: I need the RecordCount property - so I need to
change the CursorType - to adOpenStatic? Do I somehow tell Command or
RecSet?
Everything else works - but the .RecordCount returns -1 which my book
says is the default. I need to know if there are any records in the
recordset.
Any help would be appreciated.
Regards,
8-bit
PS. This is my code...
Set oCmd = New ADODB.Command
oCmd.ActiveConnection = oConn
sSQL = "SELECT * FROM table; "
oCmd.CommandType = adCmdText
oCmd.CommandText = sSQL
Set RecSet = oCmd.Execute
PPS. Please reply to group as the email I've used is bogus.