[thelist] ASP, Access and data types

Oddur Snar Magnusson oddur at gm.is
Tue Oct 10 12:25:11 CDT 2000


If you are using Jscript then do
docId = parseInt(docID)
to make it a integer or if you are using VB
docId = int(docID)
though I think in VB it should not matter.

- Oddur Magnusson

-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Jennifer Bantz
Sent: Tuesday, October 10, 2000 10:01 AM
To: thelist at lists.evolt.org
Subject: [thelist] ASP, Access and data types


Hi All,

I'm going crazy here...

I am trying to update a record in an Access database from a web page like
so:

SQL="UPDATE documents SET title = '" & title & "', "
SQL=SQL & "authorID = " & authorID & " "
SQL=SQL & "body = '" & body  & "' "
SQL=SQL & "WHERE docID =" & docID

I'm getting a "data type mismatch" error because the docID in the database
is an AutoNumber, while the docID from the page is a string (it actually
comes from the database, then becomes a string when I assign it to a
variable -- if I try to use the value straight out of a query I still get a
data type mismatch).

Am I missing something?  Seems to me that having Access assign autonumbers
would be the common way to identify unique records, especially ones created
by visitors to the site, yet trying to write back to the database by
matching to them would always generate a data type mismatch.

Help??

TIA,
Jenn


---------------------------------------
For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt ! 





More information about the thelist mailing list