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

Problem inserting auto id into my table

I can't insert auto id into my table generating error on line 20:
Expand|Select|Wrap|Line Numbers
  1. <%
  2.   Option Explicit
  3.   dim cn 
  4.   Dim rs
  5.   Dim sq
  6.   Dim i
  7.  
  8.   Set cn = Server.CreateObject("ADODB.Connection")
  9.   Set rs = Server.CreateObject("ADODB.Recordset")
  10.   cn.Open "DSN=B;UID=;PWD=;Database=Goldenlife"
  11.  
  12. %>
  13.  
  14.  
  15. <%
  16.  
  17.  
  18.  For i=10001 To 99999
  19.  
  20.    If rs.BOF  Then
  21.  
  22.  
  23.       sq="insert into Test(id,code,Date"
  24.       sq=sq & " VALUES "
  25.       sq=sq & "('" & Request.Form("id") & "',"
  26.       sq=sq & "'" & Request.Form("C") & "',"
  27.       sq=sq & "'" & Request.Form("D") & "')"
  28.       cn.Execute sq,recaffected
  29.     Else
  30.  
  31.       Do While Not (rs.Eof)
  32.  
  33.       Loop
  34.     End If
  35.   next
  36. %>
Feb 24 '11 #1
1 1683
jhardman
3,406 Expert 2GB
You shouldn't ever insert an auto-id. Skip that field and it should work.

Jared
Feb 24 '11 #2

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

Similar topics

9
by: michael | last post by:
Anyone knows if it is possible to make the complete area of a table cell a link onmousover or by hover? In other words, I'd like to link, not only the text within the cell, but the entire cell as...
3
by: trint | last post by:
Three tables (all new, no data) will receive data from dBase and be transposed into them...All three have auto generated IDENTITY columns and pk and fk constraints. Can someone provide me with an...
0
by: Alexander Vlasenko | last post by:
Please CC me, I am not subscribed. An imaginary SQL statement INSERT INTO table FETCH ... FROM cursor; looks almost the same as currently available INSERT INTO table SELECT ...; I tried it...
1
by: Cedric Robinson via .NET 247 | last post by:
(Type your message here) -------------------------------- From: Cedric Robinson Hi, I am simply trying to insert records into an access database using asp.net. I can edit and update tables all...
3
by: Björn Platzen | last post by:
Hello list, I'm a postgres-newbie with a maybe silly question. I'm working on a SuSE-Linux 9.1 with PostgreSQL 7.4.6 with PostGIS 0.9. My problem is, that I can't insert data into a table...
3
by: eighthman11 | last post by:
Hi everyone: We received a error message "Log File to Database is Full. Backup the transaction log to free up space." I have a Access 2000 application that calls a Stored Procedure that...
0
by: rickmedlin | last post by:
I know this has been posted on elsewhere but I'm stuck. I'm using the following append query to copy an Access query to Excel: INSERT INTO . SELECT * FROM Test; This isn't the real table...
2
by: rickmedlin | last post by:
I know this has been posted on elsewhere but I'm stuck. I'm using the following append query to copy an Access query to Excel: INSERT INTO . SELECT * FROM Test; This isn't the real table...
0
by: silversubey | last post by:
I am trying to convert mssql triggers to mysql. I am very new to Mysql and would like some help with my code. My queries work but there has to be a more efficient way to write them. I would greatly...
10
by: mikcutu | last post by:
Hello, I am fresh in Oracle and I encounter a problem when I want to update a field from a table which is joined with itself. Functional description: Into a table, it is possible to have a...
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.