I am using the Datagrid control called Datagrid (MSDATGRD.OCX) adn I am trying to set it' sdata source to an ADODB recordset and I am getting the Type Mismatch error, any ideas? I know my recordset is returning data (debug.print)
All i removed from my code was the actual SQL statement and the conn string value, everyting els eis identical, any help???
I have checked the below posting, but my prob doe snot seem to be that
Thanks
Copper
Dim dbconn As ADODB.Connection
Set dbconn = New ADODB.Connection
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.CursorLocation = adUseClient
Dim strSQL As String
strSQL = "SQL Select statement..."
Dim strsqlconn As String
strsqlconn = "Connection string"
dbconn.ConnectionString = strsqlconn
'dbconn.CursorLocation = adUseClient
dbconn.Open
Set rst = dbconn.Execute(strSQL)
'rst.Open , , adOpenStatic, adLockBatchOptimistic
If rst.EOF And rst.BOF Then
MsgBox "Error, Part numbers not found, Please try again or see system administrator", vbCritical
Else
'populate the datagrid with the part numbers
With dgListPartNumbers
Set .DataSource = rst
.Refresh
.Caption = "Item Lookup"
.Columns(0).Width = 1000
.Columns(1).Width = 650
.Columns(2).Width = 650
End With
End If
All i removed from my code was the actual SQL statement and the conn string value, everyting els eis identical, any help???
I have checked the below posting, but my prob doe snot seem to be that
Thanks
Copper
Dim dbconn As ADODB.Connection
Set dbconn = New ADODB.Connection
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.CursorLocation = adUseClient
Dim strSQL As String
strSQL = "SQL Select statement..."
Dim strsqlconn As String
strsqlconn = "Connection string"
dbconn.ConnectionString = strsqlconn
'dbconn.CursorLocation = adUseClient
dbconn.Open
Set rst = dbconn.Execute(strSQL)
'rst.Open , , adOpenStatic, adLockBatchOptimistic
If rst.EOF And rst.BOF Then
MsgBox "Error, Part numbers not found, Please try again or see system administrator", vbCritical
Else
'populate the datagrid with the part numbers
With dgListPartNumbers
Set .DataSource = rst
.Refresh
.Caption = "Item Lookup"
.Columns(0).Width = 1000
.Columns(1).Width = 650
.Columns(2).Width = 650
End With
End If