Database questions
Posted: Mon Mar 07, 2005 11:50 am
Hi.
I am switching from VB to PB but I am having trouble understanding how you retrieve data from access databases in PB. For example, is there a PB equivalent for the following snippet?
-------------------------------
Set oRS = New Recordset
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0" & ";Data Source=" & App.Path & "\Database.mdb"
strSQL = "SELECT Field FROM Table"
oRS.Open strSQL, strConnect, adOpenForwardOnly, adLockReadOnly
Do Until oRS.EOF
If Len(oRS.Collect("Field")) > 0 Then
lstListBox.AddItem oRS.Collect("Field")
End If
oRS.MoveNext
Loop
oRS.Close
Set oRS = Nothing
-------------------------------
I won't ask too many questions here while I am learning but this would be very helpful. Thank you.
I am switching from VB to PB but I am having trouble understanding how you retrieve data from access databases in PB. For example, is there a PB equivalent for the following snippet?
-------------------------------
Set oRS = New Recordset
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0" & ";Data Source=" & App.Path & "\Database.mdb"
strSQL = "SELECT Field FROM Table"
oRS.Open strSQL, strConnect, adOpenForwardOnly, adLockReadOnly
Do Until oRS.EOF
If Len(oRS.Collect("Field")) > 0 Then
lstListBox.AddItem oRS.Collect("Field")
End If
oRS.MoveNext
Loop
oRS.Close
Set oRS = Nothing
-------------------------------
I won't ask too many questions here while I am learning but this would be very helpful. Thank you.