S
Steven Cheng
I just recently i migrated on my Access database to SQL Express 2005 and
trying to connect to the databases with the following:
Private Sub testing()
Dim strconnect As String
Dim r As String
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
strconnect = "Provider=SQLOLEDB;Integrated Security=SSPI;Initial
Catalog=Telephone;Data Source=PH-XP01\SQLEXPRESS"
Set cn = New ADODB.Connection
cn.ConnectionString = strconnect
cn.Open
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.Source = "Select * from Accsum_30987_20080304"
.Open
.MoveLast
MsgBox .RecordCount, vbOKOnly
End With
End Sub
i keep getting an error message upon trying to execute the movelast
statement where the error message reads:
Row set does not support fetching backward.
can someone please explain where i have gone wrong here as i was able to
retrieve the field names from the table, but can move through the table like
i had with DAO.
Steven
trying to connect to the databases with the following:
Private Sub testing()
Dim strconnect As String
Dim r As String
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
strconnect = "Provider=SQLOLEDB;Integrated Security=SSPI;Initial
Catalog=Telephone;Data Source=PH-XP01\SQLEXPRESS"
Set cn = New ADODB.Connection
cn.ConnectionString = strconnect
cn.Open
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.Source = "Select * from Accsum_30987_20080304"
.Open
.MoveLast
MsgBox .RecordCount, vbOKOnly
End With
End Sub
i keep getting an error message upon trying to execute the movelast
statement where the error message reads:
Row set does not support fetching backward.
can someone please explain where i have gone wrong here as i was able to
retrieve the field names from the table, but can move through the table like
i had with DAO.
Steven