|
-
Jan 18th, 2000, 07:56 PM
#1
Thread Starter
New Member
I want to fill a datagrid using a ADO Recordset I have opened previosly, but it doesn't work. That's my code:
------------------------
Option Explicit
Public cnnoddo2 As ADODB.Connection
Public rstactivos As ADODB.Recordset
Private Sub Cmdrellenar_Click()
Dim Sql_activo As String
Set rstactivos = New ADODB.Recordset
Sql_activo = "SELECT activo FROM activo_subyacente"
rstactivos.Open Sql_activo, cnnoddo2, adOpenDynamic, adLockOptimistic
Set DataGrid1.DataSource = rstactivos
End Sub
Private Sub Form_Load()
Dim strconexion As String
Set cnnoddo2 = New ADODB.Connection
strconexion = "ODBC;DATABASE=ODDO;DSN=odbcoddo2;UID=sa" 'cadena de conexión
cnnoddo2.Open strconexion
End Sub
----------------------
I have a data type error. (Type mismatch).
Can anybody help me?. Any advice will be greatly apreciatted.
Nauj
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|