473,320 Members | 1,854 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,320 software developers and data experts.

deleting primary key

Fary4u
273 100+
i'm trying to delete the value from Access DB but the problem is following

Expand|Select|Wrap|Line Numbers
  1. Error Type:
  2. Microsoft JET Database Engine (0x80040E07)
  3. Data type mismatch in criteria expression.
  4.  
the id is primary key & auto number .

Expand|Select|Wrap|Line Numbers
  1. ors.open "select * from str where id='" & a & "'",ocon,adOpenDynamic,adLockOptimistic
any body know where the problem gonna be ?
Aug 5 '09 #1
2 1592
GazMathias
228 Expert 128KB
Hi there,

Without knowing your DB I would hazard a guess at this:

Expand|Select|Wrap|Line Numbers
  1. where id='" & a & "'"
  2.  
Is your id field textual in nature?

If not:

Expand|Select|Wrap|Line Numbers
  1. where id=" & a
  2.  
Gaz
Aug 5 '09 #2
jhardman
3,406 Expert 2GB
Gaz is right, let me clarify just in case it wasn't obvious. If you are sending text to access you need to enclose it in single quotes (Select * from BytesUsers where username = 'jhardman') but if you are sending a number you cannot use quotes (select * from BytesUsers where ID = 4321)

Jared
Aug 7 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: XmlAdoNewbie | last post by:
Hi All, I am using Microsoft SQL Enterprise Manager version 8.0 and have created a view from a combination of 4 different tables. I would like to be able to go into sql and open the view and...
1
by: dev | last post by:
Hej There. We have a big problem. We have now for 4th years had a SQL Server without problems. But sutnely some of the primary keys are deleted. The subdata to the primary keys are not deleted....
3
by: Andreas Fromm | last post by:
Hi, I have The following situation: CREATE TABLE data1 ( id SERIAL PRIMARY KEY, data INTEGER ); CREATE TABLE data2 (
1
by: Brian Keanie | last post by:
Used the "find duplicates" wizard to identify approx 500 duplicates in a single table. How do you delete the duplicates without doing it one at a time?
0
by: ET | last post by:
We have two tables... one with primary key ID and second table with secondary key to the ID in the first table... Now, they query pulls records from both tables, looks like this: SELECT...
25
by: Markus Svilans | last post by:
Hi, There seems to be some functionality missing from the STL. I am iterating through a linked list (std::list) using a reverse iterator and attempting to erase certain items from the list. It...
5
by: Manish | last post by:
The topic is related to MySQL database. Suppose a table "address" contains the following records ------------------------------------------------------- | name | address | phone |...
2
by: Greg | last post by:
I have a gridview on my form which I have populated using a datareader. What I would like to do is to be able to remove specified records from the gridview, without affecting the source of the...
1
by: Greg | last post by:
I have a gridview on my form which I have populated using a datareader. What I would like to do is to be able to remove specified records from the gridview, without affecting the source of the...
11
by: shriil | last post by:
Hi I have this database that calculates and stores the incentive amount earned by employees of a particular department. Each record is entered by entering the Date, Shift (morn, eve, or night)...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.