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

update a row using sql query and auto-increment number

hi. i want to update a row in an ACCESS DB in vb.net using sql query. the way to point to the row is using the primary key. the problem is that i was an error saying that there is a data type mismatch in criteria expression. the primary key type is auto-increment. when i change his type to text, i haven't this error anymore.
below is a part of my code:
Dim NMBR1= ds1.Tables("database").Rows(IntK).Item(76) 'NMBR1
Dim INC = ds1.Tables("database").Rows(IntK).Item(0) 'TABLE P_ID
NMBR1= NMBR1+1
sql1 = "UPDATE Table1 SET ID1 = '" & NMBR1& "' Where ID='" & INC & "' "
thanks.
Dec 19 '11 #1
1 3107
Rabbit
12,516 Expert Mod 8TB
That's because you're passing in text when it expects a number.
This is text "1", this is a number 1
Dec 19 '11 #2

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

Similar topics

7
by: Jim Geissman | last post by:
Take a table, where not all the columns are populated: CREATE TABLE #T (A int, B int, C int, D int) INSERT #T (A,B) VALUES (1,2) INSERT #T (A,B) VALUES (3,4) INSERT #T (A,B) VALUES (5,6)...
1
by: anshul | last post by:
Can somebody tell me about state management in asp.net using Query Strings. I am just unable to understand this. Anshul
4
by: Jim Hammond | last post by:
It would be udeful to be able to get the current on-screen values from a FormView that is databound to an ObjectDataSource by using a callback instead of a postback. For example: public void...
18
by: A.M | last post by:
Hi, Is there any way to call a WSS web service method by using browser and see the XML result in browser as well? I have been told that there is query string syntax for calling...
2
by: dollyvishal | last post by:
How to get constraint information for MS Access tables using Query?
0
by: =?Utf-8?B?VG9ueSBBLg==?= | last post by:
I'm trying to develop a parameter query using Query Builder, the database is Access 2003. I placed a ? in the column to we quered and linked it to a checkbox on the form. When the user selects an...
1
by: viper888 | last post by:
Hi there, How can I automate may database backup using query analyser? My routine goes this way: 1. Every 5:00pm check Enterprise manager who is currenlty logged on to sql server. 2. If there...
7
by: LaMoRt | last post by:
Hi there! Is there any way to find the user who did some transaction of update in query analyser in certain time ? The update was done manually in query analyser and is not through system....
1
by: tekedge | last post by:
Hi, I have to do an update using a query which uses CTE . Could any body please tell me how I can do an update. I am unable to update if I replace the final select with an update one. Thanks...
1
by: baburmm | last post by:
Hi all, Can any one tell me, Export datas to a Excel file using query without openrowset method is there any other methods are posible for creating an Excel file to export it Thanks,...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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.