473,320 Members | 1,865 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.

insert statement too long

50
hi all
i am doing database connection in ASP
my select statement is so long that it is running over 2 lines and im having error due to that, its been telling me incomplete string
i've used "_" to specify that the line is continuous bt ts is telling me invalid character
plzzz help
Nov 22 '07 #1
4 1569
JamieHowarth0
533 Expert 512MB
Hi poopsy,

If you could show us your code in it's entirety, we'll try and help you with where it's going wrong. Normally to use the _ character you have to end the string and re-start it like so:
Expand|Select|Wrap|Line Numbers
  1. mystring = "This is " _
  2. "a string."
  3.  
I've never had any problems with this method so if you could show us your code we may be able to help further.

Best regards,

medicineworker
Nov 22 '07 #2
shweta123
692 Expert 512MB
Hi,

Your statement is

myString as String = "This is my long teststring which I want to break into two lines."
you can break it in 2 ways :

1) myString = "This is my long teststring which " & _
"I want to break into two lines."

2) OR even you can use the concatenation operator to give long strings.
myString = "This is my long teststring which "
myString = myString & "I want to break into two lines."
Nov 23 '07 #3
poopsy
50
my code is
Expand|Select|Wrap|Line Numbers
  1. sInsert = "INSERT INTO Student (sfname, slname,saddress, home_no, semail ) values  ('" & sfname & "','"& slname & "','" & saddress & "','" & shome &"','"&  semail & "')" 
Nov 23 '07 #4
omerbutt
638 512MB
hi there some thing that i noticed in ur query is like always be strict with the format and the spaces in ur query additional spaces in the query mostly a cauz of errors in the query here i have re-written ur query copy paste it and it will not give any error hope fully and that query of urs isnt that long i have been working with 13 fields table and have written the query in the same format it never gave any errors..now for ur query
Expand|Select|Wrap|Line Numbers
  1. sInsert = "INSERT INTO Student(sfname, slname, saddress, home_no, semail ) values('"& sfname &"', '"& slname &"', '"& saddress &"', '"& shome &"', '"& semail &"')",YourconnetionString
  2.  


my code is
Expand|Select|Wrap|Line Numbers
  1. sInsert = "INSERT INTO Student (sfname, slname,saddress, home_no, semail ) values  ('" & sfname & "','"& slname & "','" & saddress & "','" & shome &"','"&  semail & "')" 
Nov 25 '07 #5

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

Similar topics

6
by: a-ok | last post by:
Hi, My client has a product database od around 20000 items. And it is updated every few days when he gets a catalog from the supplier. It's supposed to work like this: if there already is a...
8
by: Sans Spam | last post by:
Greetings! I have a table that contains all of the function permissions within a given application. These functions are different sections of a site and each has its own permissions (READ, WRITE,...
2
by: Tim::.. | last post by:
Can someone please tell me why I keep getting the following error from the code below! Error: INSERT statement conflicted with COLUMN FOREIGN KEY constraint...
2
by: Paul Mason | last post by:
Hi folks, The ado.net stream appears to be not working so I'm here. The following function generates the error "Operation must use an updateable query". There is no identifiable or meaningful...
8
by: Red | last post by:
If auto-format is turned off in VS2008, there is apparently no way to indent a line. Under Tools->Options->Text Editor->C#->Formatting, there are three checkboxes. Unchecking those seems to cause...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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

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.