Skyline
Jan 28th, 2000, 07:10 AM
Hello all!
I'm learning to use ODBC with my databas programming now. I copied one example from the VB Help. But when I'm trying to run that copied example, I'll get an error "User-defined type not defined" at first program line.
Here is the example:
Private Sub rdoColumnButton_Click()
Dim cl As rdoColumn
Dim rs As rdoResultset
Dim sSQL As String
Dim cn As rdoConnection
Dim connect As String
connect = "uid=;pwd=;database=pubs;"
Set cn = rdoEnvironments(0).OpenConnection(workdb, _
rdDriverNoPrompt, False, connect)
sSQL = "Select Pub_ID, Max(Price) BestPrice " _
& " from Titles Group by Pub_ID"
Set rs = cn.OpenResultset(sSQL, rdOpenForwardOnly, _
rdConcurReadOnly)
With rs
For Each cl In .rdoColumns
Print cl.Name; "-"; cl.Type; ":"; cl.Size, _
cl.SourceTable, cl.SourceColumn
Next cl
Print
Do Until .EOF
For Each cl In .rdoColumns
Print cl.Value,
Next cl
Print
.MoveNext
Loop
End With
End Sub
****
So, the error appears on line "Dim cl As rdoColumn".
What's matter, can someone help me!!! I have VB5 (Enterprise), WIN98...
I'm learning to use ODBC with my databas programming now. I copied one example from the VB Help. But when I'm trying to run that copied example, I'll get an error "User-defined type not defined" at first program line.
Here is the example:
Private Sub rdoColumnButton_Click()
Dim cl As rdoColumn
Dim rs As rdoResultset
Dim sSQL As String
Dim cn As rdoConnection
Dim connect As String
connect = "uid=;pwd=;database=pubs;"
Set cn = rdoEnvironments(0).OpenConnection(workdb, _
rdDriverNoPrompt, False, connect)
sSQL = "Select Pub_ID, Max(Price) BestPrice " _
& " from Titles Group by Pub_ID"
Set rs = cn.OpenResultset(sSQL, rdOpenForwardOnly, _
rdConcurReadOnly)
With rs
For Each cl In .rdoColumns
Print cl.Name; "-"; cl.Type; ":"; cl.Size, _
cl.SourceTable, cl.SourceColumn
Next cl
Do Until .EOF
For Each cl In .rdoColumns
Print cl.Value,
Next cl
.MoveNext
Loop
End With
End Sub
****
So, the error appears on line "Dim cl As rdoColumn".
What's matter, can someone help me!!! I have VB5 (Enterprise), WIN98...