
Please help - overflow error using Access 97 database
VB6.0, Visual Studio 6.0, service pack 5.0.
Running on Win2000 pro.
I get an overflow error on the "rstOrders.Open strSQL, cnn" statement.
The same software runs fine on Win98.
Any help greatly appreciated.
== Here is the form load
================================================================
Private Sub Form_Load()
On Error GoTo Err_Form_Load
'Establish a connection with data source.
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\saaborders.mdb"
Set cnn = New ADODB.Connection
cnn.Open strConnectionString
'Instantiate a Recordset object.
Set rstOrders = New ADODB.Recordset
'Open a recordset using the Open method
'and use the connection established by the Connection object.
Shopper_ID = TxtID
Shopper_ID = FrmPendingOrders.Text1(FrmPendingOrders.parm)
'Exit Sub
strSQL = "SELECT * from CustOrder WHERE shopperid = '" & Shopper_ID &
"'"
'rstOrders.Open strSQL, cnn, adOpenKeyset, adLockOptimistic, adCmdText
rstOrders.Open strSQL, cnn
'Cycle through record set and display the results
'and increment record position with MoveNext method.
x = 1
Do Until rstOrders.EOF
odesc = rstOrders("Description")
For y = Len(odesc) To 1 Step -1
If Mid$(odesc, y, 1) = " " Then
Exit For
Else
OrdNum = Mid$(odesc, y, 1) & OrdNum
End If
Next y
'Text1(x) = rstOrders("ShopperID")
Text1(x) = OrdNum
OrdNum = ""
Text2(x) = rstOrders("Description")
Text3(x) = rstOrders("Quantity")
Text4(x) = "" & Format(rstOrders("unit_Price"), "$#,##0.00")
rstOrders.MoveNext
x = x + 1
Loop
Exit Sub
Err_Form_Load:
ErrNum = Err.Number
ErrDesc = Err.Description
MsgBox "The error " & Err.Number & ": " & Err.Description & " was
generated-Form Load"
Resume Next
Exit Sub
End Sub