473,396 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 4417

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: LJgrnl | last post by:
I've got a type mismatch error that's driving me nutty. Variable blnNoData has the initial value False. If a recordset comes back empty (both .EOF and ..BOF are true) then blnNoData is set to...
4
by: Mike | last post by:
I am getting a type mismatch error when I do a bulk insert. ---Begin Error Msg--- Server: Msg 4864, Level 16, State 1, Line 1 Bulk insert data conversion error (type mismatch) for row 1, column...
0
by: news.paradise.net.nz | last post by:
I have been developing access databases for over 5 years. I have a large database and I have struck this problem with it before but can find nothing in help or online. Access 2000 I have a query...
3
by: amitbadgi | last post by:
I am getting teh following error while converting an asp application to asp.net, Exception Details: System.Runtime.InteropServices.COMException: Type mismatch. Source Error: Line...
1
by: Brett | last post by:
I have a form that calls a method within a DLL. By clicking a button on the form, the DLL is instantiated and the SaveOutlookMessage() method invoked. The DLL code copies messages from Outlook to...
6
by: Howard Kaikow | last post by:
I'm doing a VB 6 project in which I am trying to protect against type mismatch errors. Is the process any different in VB .NET? Here's what I'm doing in VB 6. I have an ActiveX DLL. The...
1
by: jodyblau | last post by:
I have a database which works fine until I create and MDE file. Once I create the MDE, when I open a particular form I get a "Type Mismatch" error. Because its an MDE file, I can't step through...
19
by: zz12 | last post by:
Hello, is there a setting in IIS 5.0 that would quickly fix the following error?: Microsoft VBScript runtime (0x800A000D) Type mismatch It's strange because some of our .asp pages were...
1
by: nckinfutz | last post by:
hello, I am having a problem with an access database. this is not my database and I did not create it, nor am I very good at access. however, I am a network engineer and that is why this problem...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.