Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Defining fields in Disconnected RecordSet 1

Status
Not open for further replies.

thornmastr

Programmer
Feb 2, 2002
1,337
US
I have created a disconnected recordset as follows:


310 Set rsInventory = New ADODB.Recordset
320 With rsInventory
330 .Fields.Append "ProductID", adChar, 20
340 .Fields.Append "Descript", adChar, 80
350 .Fields.Append "Price", adChar, 10
360 .Fields.Append "SKU", adChar, 50
370 .Fields.Append "QTY", adNumeric
380 .Fields.Append "Barcode", adChar, 20
390 .Fields.Append "Vender", adChar, 50
400 .Fields.Append "Category", adChar, 50
410 End With


The following code partially updates the recordset:

With rsprod
rs.AddNew
rs!ProductID = !ProdID
rs!Descript = !Product
rs!Price = Format(!Price, "##,##0.00")
rs!Sku = !Sku
rs!barcode = !ProdID
rs!Category = svecat
value = rsprod("QRecd") - rsprod("QSold")
value = value + rsprod("QAdjust")
rs("qty") = value

Where rs is the disconnected recordset. Before the rs.update occurs the program crashes and burns at
Rs(“qty”) = value with a “Multiple-step operation generated errors” error. I have been able to narrow this down. The qty field is not the right type. I have not been able to find out what constant is used with an append field to indicate a long numeric value. Where can I find a list of constants used to define variable types to a recordset.

I am using an Access 2002 database, using ADO, vb6 FRONT-END.

Any assistance would be most appreciated.

Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@earthlink.net
 
If you do an F2 you will bring up the object browser. Do a search for adInteger - and that is what you will want to use... unless you need floating point then use adDouble as the constant values.

These values are also explained in the help files for ADO.
 
Thank you very much.

Problem resolved.

Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@earthlink.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top