This is a multipost, not a crosspost. There is a difference. Crossposting:
sometimes OK. Multiposting: never ok.
Don't use recordsets to modify data. My suggestion would be to use a saved
parameter query. Open your database in Access, go to the Queries tab, and
create a new query in Design View (there should be a button on the database
window for this, depending on what version of Access you are using). Close
the Choose Table dialog without selecting a table, and immediately switch to
SQL View (toolbar button, menu option, or right-click context menu). Type
this into the window (assuming the table's name is "Products"):
INSERT INTO Products (Product, Description,StockNumber,
VALUES ([pProduct], [pDescription],[pStockNumber],
If you test it by clicking the Execute button in the toolbar, you will be
prompted for each parameter value. Enter some test values and then look at
the data in the table to verify that the data was entered correctly. If so,
save the query as "qInsProduct", and you are now ready to execute it from
dim cn, rs, sSQL, newID
cn.open "provider=Microsoft.Jet.OLEDB.4.0;" & _
'I would assign the values from the Request object to variables and
'validate them at this point, however, just to save space and time,
'I will illustrate using the request variables directly - YOU SHOULD
'NOT DO IT THIS WAY - validate your user's input.
'In addition, you should not make the runtime engine search
'all the Request collections for your variables. Always specify
'which collection contains the variable. IE, request.form("var")
' instead of reques("var"). Since I did not know whether you
'were passing by POST or GET, I will not specify the collection
'in this example. But you should!
cn.qInsProduct Request("Product"), _
Request("Description"), Request("StockNumber"), _
Request("CategoryID"), Request("RetailPrice"), _
Request("RetailPrice"), Request("Price"), Request("CostPrice")
sSQL = "Select IDENTITY"
Set rs = cn.Execute(sSQL,,1)
sSQL="Select Product, Description,StockNumber, " & _
"CategoryID,RetailPrice,Price,CostPrice " & _
"FROM Products WHERE ProductID = " & newID
If the incorrect values are still being displayed, verify that they were
stored that way by opening the database in Access and looking at the data.
If they were stored incorrectly, then there is probably a Regional Settings
issue that should have been taken care of by passing the values by
parameter. Let us know if this is the case.
If the correct values are in the database, then there is a display issue,
probably being caused by Regional Settings, again let us know.
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.