473,583 Members | 2,905 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ,....,registerd ate)"
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 4429

"Arun Wadhawan" <aw****@swisson line.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 ,....,registerd ate)"
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****@swisson line.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 ,....,registerd ate)"
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(iden t, ..., registerdate)
VALUES (?, ,,, ?)

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

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #3
Rowland Banks (ba*****@hotmai l.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****@sommarsk og.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 ,...,registerda te)VALUES (' & ident &
',...,' & registerdate & ')"

and

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

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

I tried also :

query = "INSERT INTO datingnew(ident ,...,registerda te)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****@swisson line.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 ,...,registerda te)VALUES (' & ident &
',...,' & registerdate & ')"

and

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

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

I tried also :

query = "INSERT INTO datingnew(ident ,...,registerda te)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
2487
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 True. I then have an if statement to determine what to write to the screen depending on blnNoData. As long as the if statement is true (doesn't have...
4
11953
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 14 (STDCOST). ---End Error Msg--- The STDCOST is set to decimal (28,14) and is a formatted in Access as a number, single with 14 decimal. I...
0
2240
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 that will run fine without any criteria but as soon as I add any criteria it gives a "Data type mismatch" error. As soon as I remove any criteria...
3
2907
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 347: 'response.Write(sql2)
1
2797
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 an HTML file. When I execute the EXE, which is only the form, and click the button, I get a "Type Mismatch" error on this line in the form:...
6
5981
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 class has stuff initialized by calling a sub SetClass that wants some Word specific objects passed-in. If the user mistakingly uses the wrong object,...
1
1659
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 the code to find out where the error is occuring; and (as I mentioned earlier) when I go back to the oriignal database the problem doesn't exist. ...
19
5529
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 working fine for the past years but recently our website was updated in that old folders were renamed and the new ones took on the existing name and was...
1
2823
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 has ended up in my lap i guess. This is the issue: There is an access database that pulls data from a list of excel spread sheets. This access...
0
7888
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7811
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8159
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8314
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6571
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3811
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3836
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1416
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.