472,119 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

type mismatch : Error

Hello
MY SQL Server is causing me this problem :
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'ident'

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >> I am getting from the table datingnew the value of the ident field.
"select max(ident)as test from datingnew"
ident = RS2("test")
ident = ident + 1

The ident value is passed over 2 sites by hidden form value. There I am
simpy trying to insert it again in the same table datingnew.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>

query = "INSERT INTO datingnew(ident,....,registerdate)"
query = query & " VALUES ('" & ident & "', '" & .... & "', '" &
registerdate & "')"

there the error message is comeing each time :>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'ident'
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>


I have tried to change the the type of ident in the table datingnew to
integer , nvarchar, ....

Tried to close the recordset each time with db.close, RS. close.

Changed the ident field to standard, but also to with and without
duplication, didnt help so far ...

Need help

kind regards Arun





Microsoft VBScript runtime error '800a000d'
Type mismatch: 'ident'
Jul 20 '05 #1
5 4309

"Arun Wadhawan" <aw****@swissonline.ch> wrote in message
news:cd**********@newshispeed.ch...
Hello
MY SQL Server is causing me this problem :
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'ident'

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >> I am getting from the table datingnew the value of the ident field.
"select max(ident)as test from datingnew"
ident = RS2("test")
ident = ident + 1

The ident value is passed over 2 sites by hidden form value. There I am
simpy trying to insert it again in the same table datingnew.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>

query = "INSERT INTO datingnew(ident,....,registerdate)"
query = query & " VALUES ('" & ident & "', '" & .... & "', '" &
registerdate & "')"

there the error message is comeing each time :>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'ident'
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>

I have tried to change the the type of ident in the table datingnew to
integer , nvarchar, ....

Tried to close the recordset each time with db.close, RS. close.

Changed the ident field to standard, but also to with and without
duplication, didnt help so far ...

Need help

kind regards Arun

It looks like you're data delimiters are wrong.
The rules are:
If data is numeric, have no delimiter
If data is String, use ' and ' (two single quotes) to delimit
If data is date use # and # (two hashes) to delimit

For example:
INSERT INTO myTable (myNumber, myString, myDate) VALUES (100, "ABC",
#31/12/1999#)

Your insert statement is: query = query & " VALUES ('" & ident & "', '" & .... & "', '" &
registerdate & "')" and it looks like you're using ' ' to delimit, meaning everything is a
string.

Also, ident = RS2("test")
ident = ident + 1


I would prob. change to
ident = RS2( "test" )
ident = CInt( ident + 1 )
or, better,
ident = CInt( RS2("test") + 1 )

Hope that helps,

Rowland.
Jul 20 '05 #2
[posted and mailed, please reply in news]

Arun Wadhawan (aw****@swissonline.ch) writes:
MY SQL Server is causing me this problem :
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'ident'
No, on behalf of your SQL Server, I like to plead innocence. That's
a VBscript error, and not an SQL Server error.
query = "INSERT INTO datingnew(ident,....,registerdate)"
query = query & " VALUES ('" & ident & "', '" & .... & "', '" &
registerdate & "')"


Presumably you need to use CStr or ident.text to convert it to text.

Then, in the next step, as Rowland pointed out, you have the SQL
delimiters wrong. There should be any single quote around the
ident value in the final SQL string.

Then again, use this syntax:

INSERT INTO datingnews(ident, ..., registerdate)
VALUES (?, ,,, ?)

And then add the parameter with .CreateParameter. Then you don't have to
worry about quoting at all.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #3
Rowland Banks (ba*****@hotmail.com) writes:
If data is date use # and # (two hashes) to delimit

For example:
INSERT INTO myTable (myNumber, myString, myDate) VALUES (100, "ABC",
#31/12/1999#)


No, this is wrong. # is used in Access, but we are talking SQL Server,
where you cannot use hashes to delimited date strings. Always use '.

Also, best format to use in SQL Server is YYYYMMDD, since this format
works with all settings.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #4
Hello
Even with your help I didnt manage it yet.

The ident field in the datingnew table is nvarchar.
ident = "test "
ident= Cstr(ident)
query = "INSERT INTO datingnew(ident,...,registerdate)VALUES (' & ident &
',...,' & registerdate & ')"

and

query = "INSERT INTO datingnew(ident,...,registerdate)VALUES ( ident,...,' &
registerdate & ')"

both the error message is :
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'ident'

I tried also :

query = "INSERT INTO datingnew(ident,...,registerdate)VALUES (" ident",...,'
& registerdate & ')"

the eror messgae is

[Microsoft][ODBC SQL Server Driver][SQL Server]The name 'ident' is not
permitted in this context. Only constants, expressions, or variables allowed
here. Column names are not permitted.

kind regards
Arun
Jul 20 '05 #5

"Arun Wadhawan" <aw****@swissonline.ch> wrote in message
news:ce**********@newshispeed.ch...
Hello
Even with your help I didnt manage it yet.

The ident field in the datingnew table is nvarchar.
ident = "test "
ident= Cstr(ident)
query = "INSERT INTO datingnew(ident,...,registerdate)VALUES (' & ident &
',...,' & registerdate & ')"

and

query = "INSERT INTO datingnew(ident,...,registerdate)VALUES ( ident,...,' & registerdate & ')"

both the error message is :
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'ident'

I tried also :

query = "INSERT INTO datingnew(ident,...,registerdate)VALUES (" ident",...,' & registerdate & ')"

the eror messgae is

[Microsoft][ODBC SQL Server Driver][SQL Server]The name 'ident' is not
permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.

kind regards
Arun


I think the code you should try would be :

query = "INSERT INTO datingnew (ident, ..., registerdate) VALUES ( '" +
ident + "', '" ... "', '" + registerdate + "')"

Note the use of apostrophes ['] (these may not be clear as the quotes ["]
hide them!). Here is the same code, with the apostophes highlighted:

query = "INSERT INTO datingnew (ident, ..., registerdate) VALUES ( [']" +
ident + "['], [']" ... "['], [']" + registerdate + "['])"

Apostrophes should be used for (I think) anything that isn't a number.
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by LJgrnl | last post: by
reply views Thread by news.paradise.net.nz | last post: by
3 posts views Thread by amitbadgi | last post: by
1 post views Thread by Brett | last post: by
6 posts views Thread by Howard Kaikow | last post: by
19 posts views Thread by zz12 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.