What is 'ADOconnect' ?
Normally you'd define a Reference to Microsoft Active Data Objects and use 'ADODB.Connection'. Also you need to initialise the RecordSet before using it in the same way you do for the connection.
Code:Private Sub Command2_Click() Dim oconn As ADODB.Connection Dim rs As ADODB.Recordset Dim strSQL As String strSQL = "SELECT * FROM ZZZJUNKPERSON" Set oconn = New ADODB.Connection Set rs = New ADODB.RecordSet oconn.Open "Provider=msdaora;ODBC;DSN=SSSS;UID=SSSSS;PWD=SSSSS;DATABASE=SSSSS" rs.CursorType = adOpenStatic rs.CursorLocation = adUseClient rs.LockType = adLockOptimistic rs.Open strSQL, oconn, , , adCmdText Set DataGrid1.DataSource = rs End Sub




Reply With Quote
