Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    ASP






SuperbHosting.net & Arvixe.com have generously sponsored dedicated servers and web hosting to ensure a reliable and scalable dedicated hosting solution for BigResource.com.







SQL Insert Into


When the following code runs it produces no errors but doesn't give proper results:

sql = "INSERT INTO TableName (Line1, Line2, Line3, Line4) VALUES ('" & lines(0) & "', '" & lines(1) & "', '" & lines(2) & "', '" & lines(3) & "')"
Response.Write(sql)
SET RS = Conn.Execute(sql)

lines() contains nothing but strings and is never empty.

The Response.Write(sql) shows the proper values going into the proper locations.

However, only Lines(0) actually populates the table. Line2, Line3, and Line4 never receive any values despite the SQL showing the proper syntax.


View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
How To Prevent Duplicate Values When Using BULK INSERT To Insert CSV To SQL Server?
How to prevent duplicate values when using BULK INSERT to insert CSV to SQL Server? Code:

View Replies !   View Related
Insert Into A Db...
Our graphic designer has just finished redeveloping our website. On the
site, we use SSL to secure the area where a user enters their personal
information to order items from us. (we do not do many transactions - maybe
1 per day...) We are a log home mfg company so they would only order plan
books, maybe a video etc...

When the user clicks "Submit Order", we want to encrypt each data item
(because of new legislation governing customer personal info etc...) and
write a record to an access db. From here it will be imported into our
Customer DB leads database...

I do not use ASP but program in VB 6 and Access 2000. ASP looks similiar in
many ways...

Does someone have a good ASP script for encrypting data? And, if so, is it
fairly strong encryption?

Also, is there any trick to writing an "insert" SQL script in ASP or is it
exactly the same as I would do in VB or Access? Maybe someone has an
"insert" script handy they could pass along including the command to
actually execute it?

View Replies !   View Related
Insert In SQL ASP
i have got a data base which contain more than one tables
one for student one for teacher and one for books

i make a fourm to read the input from the user Code:

View Replies !   View Related
Insert All At Once
Code:
mySQL="INSERT INTO products (sku, youtube, description, details) VALUES ('" &pSku& "','" &pYoutube& "','" &pDescription& "','" & pDetails& "')"
call updateDatabase(mySQL, rstemp, "insert1")

that's shortly the way i'm inserting new records.
using mysql and asp functions.

The prob is that inserting only one record every time.
if i got data for 3 records how can i make it at once
to add 3 new records in some given order into the db

View Replies !   View Related
ADO Insert
What is the best way to see if a record has inserted correctly into the datase in ASP?
Also, how to tell the user what the error is.
I am inserting like this with the ADO command object:
Dim sInsert, objCmd
set objCmd = Server.CreateObject("ADODB.Command")
sInsert = "sp_ADS_Insert_Driver_General_Data "
on error resume next
With objCmd
.ActiveConnection = oConnEnergy
.CommandText = sInsert
.CommandType = adCmdStoredProc
.Execute , , adExecuteNoRecords

View Replies !   View Related
DB Insert
Application X has three screens. The user captures information on screen one and then clicks a navigation button to go onto screen two.He does the same on screen three. At the bottom of screen three is a submit button. When this button is clicked the system does some calculations with the information that is supplied and then uploads all the info that was captured on the screens to the database.

Should the data be uploaded to the database all on one go when the user clicks the submit button or should it be uploaded after each screen - ie when the user clicks the button on Screen 1 the data is uploaded to the database and then screen two is displayed.

View Replies !   View Related
Insert
i have this insert statement that is giving me trouble, the problem is with expiration_date field the error i'm getting is:

Syntax error in date in query expression '##'.Code:

SQL_Insert = "Insert INTO TableName(ColumnX, ColumnY, ColumnZ, ColumnZZ, ColumnXX, ColunmYY, Expiration_Date) values ('" & _
ColumnX& "', '" & ColumnY & "', '" & ColumnZ & "', '" & ColumnZZ & "', '" & ColumnXX& "', '" & ColunmYY & "', #" & Expiration_Date & "#)"

View Replies !   View Related
Odd Insert Into MS SQL
I have a column call UserDate and it's properties are this : varchar(50) . I have a function which updates the column with todays date. for some reason, if I manualy give the value to be inserted a value of '10/10/2006' or use date() it inserts a value of 0 if I give a value of 4 to be inserted it works?

I have been working on a project for 2 days and this is the last piece to get it to work, can anyone point out where I'm going wrong. P.S I have tried giving the colum a date format but unfotunately the format is american and I need it in english to compare with something else I'm working on.

View Replies !   View Related
Get Last Insert?
How can i get the last inserted record in an ASP ACCESS combination? Code:

View Replies !   View Related
Insert In DB
I'm looking for tutorials on how to upload a file (.doc or .pdf),insert in database and retreive from database. i'm using pure asp and sql 2000.

View Replies !   View Related
INSERT
I'm getting a syntax error when I try to run this SQL Insert statement, can anyone tell me what might be wrong? Before I was getting a data type mismatch error then I removed the ' quotes around the intPhone variable. The error occurs on the line after the SQL statement.

strSQL = "INSERT INTO candidates (Name, Grade, CivilService, Branch, Department, Sector, Town, EmailAddress, PhoneNumber, LunchReq, SpecialReq) VALUES ('" & strName & "','" & strGrade & "', '" & strCivilService & "', '" & strBranch & "', '" & strDepartment & "', '" & strSector & "', '" & strTown & "', '" & strEmail & "', " & intPhone & ", '" & strLunchReq & "', '" & strSpecialReq & "')"

Set rs = cn.Execute(strSQL)

View Replies !   View Related
Insert Value Problems
I have a 2 asp pages for a registration form. The first one is where the user types the data, and the second one has a form that requests the data from the 1st one and then sends it to the database. Both are sending the data correctly (I've seen it on the error page) but it's not feeding the DB.

View Replies !   View Related
Insert An Image
I have a website I am working on that I did not create. It is ASP and SQL based. There is a content management system created using ASP and saving in the SQL server database. A user can enter a news article into a big text box/area, and choose to add an image. The text and image are stored in the database via ASP and pulled out to the website via ASP.

The image shows up in the website to the top left of the article. I need to make it so the user can enter an image where their cursor is in the paragraph (like a word document) and have it also show up there on the website. Any ideas?

View Replies !   View Related
Insert ASP Code In JS
I have a problem. I have ASP code and Javascript code. Now, I want to access ASP code inside javascript code. Here is the ASP code:

View Replies !   View Related
Insert Values In DB
I have a form which the user fills and submits.i have insert statement there.
When i submit the form to itself ,the values get submitted and inserted in DB easily.

<form method="post" action="Infoviewagentver212.asp" name="form">

Now when i want the user to hit submit and go to other page i change the above to:
<form method="post" action="newpage.asp" name="form">

but here what happens is my values are not getting inserted in the DB??
How do i do this?

View Replies !   View Related
INSERT INTO DB Problem
This is on my HTML page

<td align=center>
<textarea cols="85" rows="7" name=""Problem"></textarea>
</td>

User" enters information into this box.

If they use either a quote or double quote, but SQL statement bombs. Is
there a way quick way to fix this beforehand?
Conn.execute ("INSERT INTO PROBLEMS (Problem) VALUES ('" & Problem & "')")

View Replies !   View Related
How To Insert Field By SQL
How to insert fields in a table by using SQL?

View Replies !   View Related
ASP Insert Process
Just like to know if I am correct and no problems in this scenario:

I have page where the user clicks a button to save some information >>

gets directed to page 2 where a value gets returned from a recordset and the form is inserted automatically upon loading with the value (sequential for the database table) >>

the user then gets redirected to page 3 upon insertion into the database, if I use 'Select Top 1 ......' as a query to retrieve some information on this page am I sure that this is the correct record just inserted even if 2 or more people are saving at the same time?

View Replies !   View Related
Using Multiple INSERT In An If Then End If
This is my code, for some reason, when I use this exact code it doesn't update my database, but if I use the next section of code it does. Anybody knows why that when I use two different "Insert" in If Then End If, it doesn't work? Oh and I did try the "If PID = 105 OR 151 Then" alone and it works well. Code:

View Replies !   View Related
Insert Data In My Db
I've been choosing to insert data ni my db using a recordset with methods AddNew and Update. I would like some advices to make my coding opractice better. For example: am I doing it right? Is there a better to do what I'm doing and so on...:

Code:
set rsExample = Server.CreateObject("ADODB.RecordSet")
rsExample.Open "example", MyConn, adOpenStatic, adLockOptimistic, adCmdTable
rsExample.AddNew

rsExample("id")=id
rsExample("firstName") = firstName
rsExample("lastName") = firstName
rsExample("subject") = subject
rsExample("message") = message
rsExample("new") = 1
rsExample("date") = now

View Replies !   View Related
Insert Into All Fields
is there a way to write a insert statment with out typing out all of my field names? i want to do an insert in every field but i don't want to have to write them all out.

View Replies !   View Related
INSERT INTO Not Inserting
I'm using ASP + MS SQL. I wrote a simple insert into command but nothing is happening... it gave no error and no information is stored in the db. When I response.write my SQL, I got the following:

INSERT INTO [blog_entries](title,user,entry,date) VALUES('test','admin','test','Tuesday, December 25, 2007')


View Replies !   View Related
Join Insert
How can i insert a data using a join statement

insert into partmaster.p, execmaster.e(e.execno, e.model, e.battqty, p.partno, p.parttype, p.itemtype, p.stacklength, p.line, p.execno)
values('1234567890', 'GBM', '2', '9876543210', 'AR', 'M', '29V', '2', '1234567890')


i have a few input box for the user to enter. but as u can see that both tables has execno. it's for both tables to connect. that's why i want to check on how i can key in one input box insert into execno in two different tables

View Replies !   View Related
Insert Date
SQL_query = "insert into Activity_Status(UserID, TotalTime, Score, Activity_Name, Status) Values('" + Request.Form("username") +"'," + Request.Form("time") + "," + Request.Form("QuizScore") + ",'"+ Request.Form("QuizType") + "'," + "'" + Request.Form("status") + "')"

How shld I insert a date to this statement?

View Replies !   View Related
(ChiliSoft) Insert
Current setup: Sun server running Solaris 9, Apache, Chilisoft ASP, MySQL

I'm having problems inserting data into MySQL from an ASP vbscript insert page
I am using Dreamweaver to create the forms for ease of use. When I try to insert a record via the table only the first field in the form is inserted into the database and any subsequent fields are ignored
I tried creating a test table with just three fields (id (auto_increment), helptitle, helpinfo)
The helptitle field is inserted fine and the record is assigned an ID but the subsequent helpinfo field is not inserted at all
I then tried creating an insert page using ASP JavaScript and all the fields were correctly inserted

View Replies !   View Related
Insert Values
Iam trying to insert values into my database, but i keep on getting this error, Code:

Subscript out of range: '[number: 1]'

I have tried to check my insert values but i can't pickup anything, can anyone assist me in this regard. Here is the portion of the code:

View Replies !   View Related
Looping Insert
I'm currently having some major problems with an insert form that I created
Basically, if a large amount of information is being inserted into the database I get an error
This seems to be a restriction imposed by the host
What I would ideally like to be able to do is to grab so many characters from the textarea insert this into the database and loop this until everything has been inserted (the information would all need to be inserted into the same field of a record)
I've never tried this before so would appreciate any advice/tips on how to go about doing this

View Replies !   View Related
Insert Into - Using Numerics
I have an Access database with Numeric fields. In my ASP code I'm
trying to use a variable to enter those numbers, such as
Insert into MyTable (Item, N1, N2) Values ('NewThing', v1, v2)

I have set v1 and v2 previously with numeric values but they are not
recognized. Do I need to wrap v1 and v2 in some sort of identifier,
such as "#"?

View Replies !   View Related
Insert Form
I am geting this message when INSERTING a form.

Microsoft JET Database Engineerror '80004005'

Operation must use an updateable query. /admin_pportfolio_bl_insert_processor.asp, line 8

the code on "admin_pportfolio_bl_insert_processor.asp" is Code:

View Replies !   View Related
Insert Statment
Now here is my insert statment and it is giving me this error message:

Insert Record
'strSQL2 = "INSERT INTO tblCONTENT_Links (LinkID, ContentOwner_UserGroupID, ContentGrouping, LinkHeaderOrder, LinkDescription, LinkName, LinkURL, LinkHeader, LinkHeaderCategory, LinkRefSite, Active, Archive, UpdatedDate, UpdatedBy, PasswordProtected, CommonLibrary) values ( 141, 7,'public', " & Category & " ,'" & DocumentName & "','" & DocumentTitle & "', '" & Document & "', 0 , 28 , 'www.skyclimber.com', -1 , 0 , #8/27/2004# , 0 , 0, -1)"

IE error:

Syntax error in INSERT INTO statement.

View Replies !   View Related
Too Long To Insert
I want to insert a new row in my db but it says that the "identifier is too long"...

ORA-00972: identifier is too long

to be more precised... I googled it but I can't seem to pinpoint how to work around this

View Replies !   View Related
Insert All Records
I am trying to figure out a way to insert all the records from a dynamic table - repeat region into one table as individual records. On the 1st page users select which items they want from a large list. When they click submit it passes the values ( IDs ) with a URL par to the next form. This form has a recordset that uses the URL par from the last page and creates a new dynamic table - repeat regon with all the records they chose. I need to do this so I can then add up rates for those selected items. I need to find a way to the add all those selected records now into one table. Also I need to have them insert each record at a time. So if 4 records are in the recordset and repeat region, I need to have it add 4 records into the table. Hope that makes since. Im a bit lost on this one.

View Replies !   View Related
INSERT INTO - Syntax
ive made the most simple page in the world in ASP, and I cannot for the life of me figure out why this page doesn work. whenever I try, it comes up woth "syntax error in statement".. Code:

View Replies !   View Related
Insert Problem
I am trying to insert some records in to a table via an ODBC connection to an older db.

Problem is, I cannot insert a record because one of my fields that is required, needs to have 3 blank spaces inserted in it in order for the insert to be successful.

However, when I print out my insert statement, the spaces go away, and I am not trimming the field or anything. Just inserting the value as " "

Any ideas how I can insert a 3 character string of spaces in to a database?

View Replies !   View Related
Sql Insert Error
I'm working on an asp where I wanted to do a simple insert using data
from another table, structure is:
Table A has columns - ID, Code, Type
Table B has columns - key, FName, LNAme, DOB, cd, etc...

I need to insert into A, using only the 'key' field from B, rest of the
values in A will be hardcoded in (code='XYZ', TYPE='A')

I tried this:
insert into TableA
values
(select key from TableB where cd='app', 'XYZ', 'A')

but it didn't work, I kept getting an error 'Missing Expression', using
Oracle 9i.
Also tried speicifying the columns
insert into TableA (ID, Code, Type)
values
(select key from TableB where cd='app', 'XYZ', 'A')


View Replies !   View Related
Time Insert
I've got a site with multiple sections (jobs, clubs, motor, property etc), and have banner adverts displaying. Banner adverts have defined start and finish dates to allow advertisers to have period campaigns. They can also choose which section to display in, as well as location of advert (banner, side, base) on page.

But I would also like to break it down further for them to have an option of starting at 01/06/2004 06:00pm to 31/06/2004 09:45pm as an example.

Firstly, I need to find a time selector to enter the times into 'form field'. any help there? I have a date selector, but no time facility...

Secondly, I need to develop the correct select statement.
here is the date part of it:

strSQL = strSQL & " AND START_DATE >= DATE()"
strSQL = strSQL & " AND FINISH_DATE <= DATE()"

The problem I know if I simply put the time being greater than and less than, then the advert will only be seen between those times on those days in database, but I need them to be seen between the time on start day to the time on finish time, and all inclusive.

View Replies !   View Related
Insert Records
Is it possible when you insert a record in a database to only insert max 5 records. Can i make it delete the oldest one when i want to insert record #6 and so on?

View Replies !   View Related
Insert Name Of File
I have a form that uploads a file (i'm using Freeaspupload) and I wish to insert the name of the uploaded file into the database.
I'm just a little unsure of what code to use from the upload script to insert the name of the file.

<%
updatenewssql = "UPDATE news_tbl SET news_image = '" & Upload.UploadedFiles(fileKey).FileName & "' Where news_id = " & Request.Form("news_id") & " "
set updatenews = crofts.execute(updatenewssql)
%>

View Replies !   View Related
Getting The ID From An Insert Statement
I am using ASP to talk to an SQL database. Most of my tables have a primary key named 'ID'. Is there a way to grab the ID of a record in the same line as the INSERT statement?

View Replies !   View Related
MASS Insert Using ASP/SQL
I have a table in SQL server, that has three columns:

ID, Asset, Keywords.

i.e.
ID Asset Keywords
1 Car Mercedes
2 Car Toyota
3 Color Blue

Ok, what I'm trying to do through my asp page (since I cannot do it through SQL, seeing as how it appears that what I want to achieve would be outside the scope of why it was created)... is I'm trying to run a query that will get a list of the assets available and then string the keywords for that asset to a variable. Code:

View Replies !   View Related
Insert And Update In Asp
this programe is read date for excel and export to mdb,if there exist the BID in mdb then update the date,else inert the date to mdb. Code:

View Replies !   View Related
Insert Into Database
Im using microsoft access and I made the field data type Yes/no. How can i enter data of type (Yes/No) to database?

View Replies !   View Related
INSERT Without Submit
Can I use "insert" statement without actually having to have the submit button?

View Replies !   View Related
INSERT INTO SQL Command
I am trying to insert a record into the LOG database when a user insert/update any record. I tried to log the username that currently logged in. If I do Response.write(Session("MM_Username")) then I see the username that I am logged in.

The below command if I use that fake value then it works, but I tried to log the current username it won't work. I think "Response.write(Session("MM_Username")) is NOT correct.

MM_editQuery = "INSERT INTO LOG (username) VALUES (" & (Session("MM_Username")) & ") "

View Replies !   View Related
ASP With SQL Insert Statements
Question 1: How can have th asp script automatically convert the date generated by the system to a format which is acceptable by Sybase SQL (yyyymmdd)

Question 2: If the user were to insert a a string containing " ' ", how can I convert it into a special character so that it won't be treated by Sybase SQL as the start/end of a variable?

View Replies !   View Related
Insert Into Problem
i am trying to do a simple insert into statement but it comes out with this " Syntax error in INSERT INTO statement. " error when i try 2 use it and the insert into code is down below : Code:

View Replies !   View Related
Insert Array Value
I have a javascript array with some values entered by the user, now i want to store these array values into the database table. How can i do that.

View Replies !   View Related
Insert Image
i created a table and a field with blob datatype. now i want to insert an image into the mysql database.i tried through the insert command but i assume that is not the right way. I gave the path where the picture is stored. but it stores it on the database as a string.

View Replies !   View Related
Recordset Insert
I'm using ASP 3.0 and SQL Server 2000. I do a insert from a form into a table. When I do the insert I get a error that the primary key cannot be Null.

any good articles or tips on how to do a insert when youhave a primary key that is auto increment? Or how to handle the primary key insert.

View Replies !   View Related
Insert Record
Is it possible to, whilst inserting a new record, use a session variable from a previous page for one of the fields?

View Replies !   View Related
Insert A Header
Anyone know how to insert a header and footer and page numbers into word when using

Response.ContentType = "application/msword"

View Replies !   View Related
Insert Files
I have a folder on my server that I have a bunch of various images in. I was to write some code so that the asp will read all files in that folder and automatically insert them into a database. Which means when I go in there and add 5 files to this folder, the page will see those 5 new files and add them to a database.It doesnt have to be exactly when I add them.Maybe once a day it could do a scan of the folder or what not.

View Replies !   View Related

Copyright 2005-08 www.BigResource.com, All rights reserved