473,715 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL Inser Problem

I have a problem inserting items into a database.
My code is below. What happens is sometimes it brings up and error
then if i hit refresh it goes through, but it wont enter my
information into the database. It enters a row and doesnt put anything
into it.

conn = "Provider=SQLOL EDB.1;Data Source=smithweb 2; Initial
Catalog=i65sale s; Persist Security Info=False;User ID=test;Passwor d="
'Application("c onn")
Set sqlstring = Server.CreateOb ject("ADODB.Con nection")
sqlstring.Open conn
SQL = "INSERT INTO i65 (itemid, itemname, description, price, group1,
group2, group3, thumbnail, picture, weight) VALUES ('" & itemid &
"','" & itemname & "','" & description & "',Convert(mone y,'" & price &
"'),'" & group1 & "','" & group2 & "','" & group3 & "','" & thumb &
"','" & picture & "','" & weight & "')"

sqlstring.Execu te(SQL)
Response.Redire ct "didit.asp"

Here is my output whenever i have it write it out:

INSERT INTO i65 (itemid, itemname, description, price, group1, group2,
group3, thumbnail, picture, weight) VALUES
('test','test', 'test',Convert( money,'12'),'Un iversal','Exter ior','Cleaner', 'test','test',' 1')
Jul 19 '05 #1
2 2157
What error? There's nothing glaringly obvious that I see wrong with your
code below.

Ray at work

"jeef" <je*******@hotm ail.com> wrote in message
news:9f******** *************** ***@posting.goo gle.com...
I have a problem inserting items into a database.
My code is below. What happens is sometimes it brings up and error
then if i hit refresh it goes through, but it wont enter my
information into the database. It enters a row and doesnt put anything
into it.

conn = "Provider=SQLOL EDB.1;Data Source=smithweb 2; Initial
Catalog=i65sale s; Persist Security Info=False;User ID=test;Passwor d="
'Application("c onn")
Set sqlstring = Server.CreateOb ject("ADODB.Con nection")
sqlstring.Open conn
SQL = "INSERT INTO i65 (itemid, itemname, description, price, group1,
group2, group3, thumbnail, picture, weight) VALUES ('" & itemid &
"','" & itemname & "','" & description & "',Convert(mone y,'" & price &
"'),'" & group1 & "','" & group2 & "','" & group3 & "','" & thumb &
"','" & picture & "','" & weight & "')"

sqlstring.Execu te(SQL)
Response.Redire ct "didit.asp"

Here is my output whenever i have it write it out:

INSERT INTO i65 (itemid, itemname, description, price, group1, group2,
group3, thumbnail, picture, weight) VALUES

('test','test', 'test',Convert( money,'12'),'Un iversal','Exter ior','Cleaner', '
test','test','1 ')
Jul 19 '05 #2
> What happens is sometimes it brings up and error

Could you be more specific?

Also, are all those datatypes char/varchar expect the price column? Are
there any triggers on the table, computed columns, etc? Primary key
constraints? Is your ASP code using on error resume next anywhere?

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1085
by: FreakET | last post by:
ok, the sittuation is that i've a table with 2 cols. one is named 'name' and the other 'lastupdate'. i declared name as unique. now i want to insert something and if it exist i only want to update the lastupdate col. i read in the manual and found INSERT foo ON DUPLICATE UPDATE foo
117
7216
by: Peter Olcott | last post by:
www.halting-problem.com
28
5216
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass(); .... and then call the virtual method, why is it that the base class's method is called instead of the overridden method? How do I fix this if I don't know at runtime what the child class is? I'm using Activator.CreateInstance() to load the...
10
1303
by: Kristian | last post by:
Hello, I can't get info from my web form into my Access database. The connection works. I've tried a command with CommandText = "Insert Into..." Error! "You have to have a query that allows changes..." With DataAdapter and Dataset I don't get any errors, but the record isn't added either. Sequrity issues? Grateful for any tip,
4
3553
by: Krij | last post by:
Hi! Can anybody tell me what I'm missing here? I'm trying to insert a new record into a sql-database from code at runtime (not stored procedure), but get the following error message: "The 'strUn' is not permitted in this context. Only constants, expressions or variables allowed here.
1
1587
by: flash | last post by:
Need hlep to delete array only because all function is ok (inser, sort andsearch) #include <iostream.h> //functions prototype void Insert(int,int); void Delete(int,int); int Search(int,int); void Sort(int,int);
3
1326
by: Swordfish Dundee | last post by:
Hi Guys, Complete newbvie here, trying to get an answer to my problem. I have written small client / server applications, in which everything that the server does is recorded in a logfile using the MY.Computer.Filesystem string. I can write the statement to the file and create a new liine for example. Server Activity - Server Started Client Activity Client Activity - User Smith has succesfully logged in
2
3365
by: wugon.net | last post by:
Problem: after inser trigger encounter error sql0348 Env:db2 v8 + fp 13 + win xp Description: we build two after insert triggers DB2.TRG1, DB2.TRG2 on base table DB2.TEST1, insert data into DB2.TEST1 encounter error sql0348 but we re-create trigger DB2.TRG2 before DB2.TRG1 and re-insert data
2
2698
by: alivip | last post by:
when I wont to inser (anyting I print) to the textbox it will not inser it just print then hanging # a look at the Tkinter Text widget # use ctrl+c to copy, ctrl+x to cut selected text, # ctrl+v to paste, and ctrl+/ to select all # count words in a text and show the first ten items # by decreasing frequency
0
8817
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8715
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9039
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7966
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5964
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4472
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3171
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2116
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.