Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

where is wrong

Posted on 2011-02-28
9
Medium Priority
?
241 Views
Last Modified: 2012-05-11
Please let me know where is wrong in the below setence

INSERT INTO ProcessLog..log_sqlwww_tbl ("As_Of_Date","UserInfo","WebPageInfo") values getdate() ,'"& request.ServerVariables ("AUTH_USER") &"','"& Request.ServerVariables("PATH_INFO") &"'"

I am getting the error  " Expected end of statement


0
Comment
Question by:petersti
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34999600
Mainly after 'values' you need to open ( and close at last )

INSERT INTO TABLE (COLUMN1, COLUMN2) VALUES (VALUE1, VALUE2)

Raj
0
 

Author Comment

by:petersti
ID: 34999773
"INSERT INTO ProcessLog..log_sqlwww_tbl ("As_Of_Date","UserInfo","WebPageInfo") values (select getdate() ,'"& request.ServerVariables ("AUTH_USER") &"','"& Request.ServerVariables("PATH_INFO") &"')"

I updated still I am getting the same error
0
 
LVL 11

Expert Comment

by:LambertHeenan
ID: 34999792
Too many dots in the firstpart...

INSERT INTO ProcessLog..log_sqlwww_tbl

Try

INSERT INTO ProcessLog.log_sqlwww_tbl
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 23

Accepted Solution

by:
Rajkumar Gs earned 2000 total points
ID: 34999816
Try this one
"INSERT INTO ProcessLog..log_sqlwww_tbl (As_Of_Date,UserInfo,WebPageInfo) values (select getdate() ,'" & _
        Request.ServerVariables("AUTH_USER") & _
        "','" & Request.ServerVariables("PATH_INFO") & "')"

Open in new window


Raj
0
 

Author Comment

by:petersti
ID: 34999825
INSERT INTO ProcessLog..log_sqlwww_tbl

this is correct
It has 2 dots
0
 

Author Comment

by:petersti
ID: 34999884
Hi RajKUmar,
It worked for me .
I have One quick qtn
When I tried in SQL
INSERT INTO ProcessLog..log_sqlwww_tbl ("As_Of_Date","UserInfo","WebPageInfo") values ('20110225' ,'test1','test3')  ----- it worked
Why it did not work in asp page "As_of_date","Userinfo","Webpageinfo"

Please let me know
Thanks a lot
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34999973
INSERT INTO TABLE ("COLUMN1") VALUES (1)
is same as
INSERT INTO TABLE (COLUMN1) VALUES (1)
in SQL

But if you try the double quotes in vb code, double quotes will break the string from there
Your code
"INSERT INTO ProcessLog..log_sqlwww_tbl ("As_Of_Date","UserInfo","WebPageInfo") values (select getdate() ,'"& request.ServerVariables ("AUTH_USER") &"','"& Request.ServerVariables("PATH_INFO") &"')"

first double quotes will stop the string there.
"INSERT INTO ProcessLog..log_sqlwww_tbl ("
then cause concatenation issue

Raj

"test
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34999989
If you want double-quotes in vb code, here it is
"INSERT INTO ProcessLog..log_sqlwww_tbl (""As_Of_Date"",""UserInfo"",""WebPageInfo"") values (select getdate() ,'" & Request.ServerVariables("AUTH_USER") & "','" & Request.ServerVariables("PATH_INFO") & "')"

Open in new window


use two double-quotes

Raj
0
 

Author Closing Comment

by:petersti
ID: 35001162
This solution solved my problem
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question