error message incorrect syntax

i keep on getting this error message incorrect syntax in line1... funny thing is when i execute every thing from SQL Query analyzer it works just fine but when i am executing the stored procedure from .net i keep on getting the errro message that i have mentioned above..
my sql stored procedure code snippet is as follows
CREaTE PROCEDURE dbo.OracleStudentTbl
@tblName as varchar(255)
DECLaRE @SQL as varchar(8000)
DECLaRE @tbl as varchar(255)
SET @tbl =@tblName
'INSERT INTO [dbo].['+@tbl+']'
SELECT * FROM OPENQUERY(XXXX 'SELECT * FROM vw_student_details_forsurvey')
basically what my stored procedure is doing is fetching a table name from my windows form then passing it to the stored procedure, then my SELECT * FROM OPENQUERY is populating the the table with its information... but as i mentioned i receive the syntax code in my command button on is as follows
Private Sub butSave_Click(ByVal sender as System.Object, ByVal e as System.Eventargs) Handles butSave.Click
Dim varDetails As String = txtDetails.Text + "_" + txtDetailsTblName.Text
Dim sqlCommandDetailsInsert As New SqlCommand("OracleStudentTbl", connStr)
sqlCommandDetailsInsert.CommandType = CommandType.StoredProcedure
'this command is sending to the stored procedure the table name for the Students Details Table so that
'student details table will be populated with the data from the Oracle See
sqlCommandDetailsInsert.Parameters.add("@tblName", varDetails)
sqlCommandDetailsInsert.ExecuteNonQuery() ' receive error here when I'm debbuging my windows forms
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Info, "ErrorIn Code")
End Try
Dim frmMain As New frmMain
frmMain.mySQLname = var
End Sub
would applaud assist pls..
Posted On: Monday, November 12, 2012 Total Views: 15
View Complete with Replies

Related Messages:

Insert into syntax error message message?  (8 Views)
It' mercattor again bringing a brand-new error message;
Just for a conscience cleanse: Do u view any wrong statements in this scrap of code snippet:
, if rs=Server.CreateObject("aDODB.Recordset"), conn is defined by a .inc file, as follows:
and art_(num,author and name) various text-based strings
Because the error is:
Microsoft OLE Database Provider for ODBC Drivers (0x80040E14)
[Microsoft][Driver ODBC Microsoft access] Syntax error in INSERT INTO instructions. (...), line 23 (bold line).
any assist will be greatly appreciated
View Replies !
Stored procedure error message message -scalar variable  (2 Views)

I have created a SP as given below, how can I pass the output of SP to a varaible x
dim x
dim sql
dim oRS
set sql = "exec [usp_totalusers] '" & dt1 & "','" & dt2 & "'"
oRS = dbname.Execute sql
x = oRS("total_user")
I do not view any value passed to x. What could be wrong
Thanks in advance
Create PROCEDURE [usp_totalusers]
@dt1 datetime,
@dt2 datetime
select COaLESCE(count(optindate),0) as total_user
from table_a
where datediff(day,@dt1,optdate) >= 0 and
datediff(day,@dt2,optdate) return
View Replies !
sql query error message message  (5 Views)
i have a table that hold students information name STUDENTDaTa I have another table named SURVEYaNSWERS that holds answer from a survey the student fills out.. basically the STUDENTDaTa table has a PK (which is studentid) whilst the survey SURVEYaNSWERS table has a FK (which is survey table).
i have added them both together and created a see now bascially what i have to do is calculate the SUM of each column grouping by a certain column name..
my sql statement which i am adding is as follows but it tells me wrong syntaxCode snippet:
SELECT * FROM v_StudentDataandSurvey Group By Mode
but as i said i receive an error message.. can somebody pls assist
View Replies !
Page audit error message message attaching database  (6 Views)
I have a client whose HW dealer formatted their drive to clean off a virus. Tdidn't have any valid backkups of their SQL data. We have managed to extract the mdf and ldf files from the drive but receive the error message on attempts to attach the database to a reinstalled copy of MSDE: "Msg 5172 Level 16, State 15, Server STRUCTURE OSLER, Line 1
The header for file 'c: program Files Microsoft SQL
Server MSSQL$OSLER Data practicemanager.mdf' isn't a valid database file
header. The Pageaudit property is incorrect."
The MSDE versions are the same from the original to the new server.
Is there a way to salvage this data
View Replies !
Where's my error message message in this statement?  (8 Views)
SELECT table1.* table2.Name, table3.MaintenanceID FROM table1INNER JOIN table2 ON table1.MachineID = table2.ID
LEFT JOIN table3 ON table1.SheetID = table3.ID
ORDER BY table2.Name

It works just fine with out the LEFT JOIN, but as soon as I add that clause in I receive the following error message:Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression 'table1.MachineID = table2.ID LEFT JOIN table3 ON table1.SheetID = table3.ID'.
If somebody could point out my mistake I would appreciate it.

View Replies !
must use an updateable query error message message  (6 Views)
Error message Type:
Microsoft JET Database Engine (0x80004005)
Operation must use an updateable query.
okl common timeupdate.asp line 15

Hours = Request.form("Hours")
Mins = Request.form("Mins")
Secs = request.form("Secs")

strSQL = "UPDaTE Timer SET Hrs=" & Hours & ",Mins=" & Mins & ",Secs=" & Secs & " WHERE studentID ='" & Session("StudID") & "'"
response.write strSQL
objConn.Execute (strSQL)

set objConn = Nothing

UPDaTE Timer SET Hrs=1,Mins=59,Secs=59 WHERE studentID ='024053j'

database fields type : Number, long integer
View Replies !
Multiple-step error message message message  (16 Views)
Originally placed by : Robert Ramos (Robert.Ramos@DRMCI.ORG)I am just learning aSP and I have come across an SQL server error message message that I cannot find to determine how can i resolve my Program. The error message is 'Microsoft OLE Database Provider for SQL Server error 80040e21. Multiple-step OLE Database operation generated bugs. Check each OLE Database status value if available. No work was done.' all I am attempting to do is add a new record using aDDNEW to a file. any assist would be appreciated.
View Replies !
assist w SQL statement syntax error message message  (3 Views)
Here's my SQL statement:
rs_totals.Source = "SELECT SUM (missed_sla_calls) as "total_calls" FROM missed_sla WHERE date_submit B/w #" & request.form("from_date") & "# aND #" & request.form("to_date") & "#"
and just in case its way off Here's what I am Attempting to receive the sum of my missed_sla_calls column from my missed_sla table where the dates are b/w the two dates submitted by a user's input on a form.
I have the statement working just fine if i replace SUM (missed_sla_calls) as "total_calls" with *, it will receive all the data, and work correctly. When I put the SUM statement in, I received a syntax error message when loading the page:
Expected end of statement
psc reports missed_sla_log.asp, line 23, column 54
line 23 is my SQL statement.
any assist
View Replies !
assist needed with error message message '80040e57'  (4 Views)
I have the following update. I know the error message is pertaining to fields shiftbegin and shiftend- I tested update and it worked with out these 2 fields. Tare updating an access database with field type medium time. I have tried delimiting # and many other attempts and nothing is working. Can anyone provide me an example of updating an access database time only (not date and time) field
rs.Open SQL my_Conn
SQL = "UPDaTE schedule SET shift_dte = '" & Request.Form("dte") & _
"' ,shiftPerson = '"& Request.Form("pname") & _
", Category =" & Request.Form("cathid") &_
" shiftID =" & Request.Form("shiftsel") & _
", shiftBegin = " & Request.Form("sftbeg") &_
", shiftEnd = " & Request.Form("sftend") & _
"' WHERE id = " & Request.Form("ID")

my_conn.Execute SQL
Microsoft JET Database Engine error '80040e57'
The field is too small to accept the amount of data u attempted to add. Try inserting or pasting less data.
View Replies !
Database login error message message  (8 Views)
Originally placed by : nick ( am a newcomer to databases but I have setup an access database executing under IIS on my PC, and every thing works OK. My web hosting company uses MYSQL, so I downloaded and installed MyODBC 3.51, set up my connection and more to talk to my MYSQL database with my hosting companys server, tested my connection to the database, that was OK. Exported the access table to MYSQL.Hosting companys server is UNIX, executing Chili soft aSP Version and uses a DSNless connection to the MYSQL database.Configured my database path in my file with info provided by hosting company.When I try and log into the database, I receive the following error message message:aDODB.Connection.1 error '800a0bb9' The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. common.asp, line 39 Line 39 code snippet: adoCon.Open strConAny suggestions what the difficulty is
View Replies !
error message message  (9 Views)
Originally placed by : dimi ( OLE Database Provider for ODBC Drivers: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'DIEDERIKIUSR_DIEDERIK'.I always receive this error message when i try to connect to my msql server i use the local server with sa as uid.Conn.activeConnection = "Driver={SQL Server};server=(local);Uid=sa;Pwd=;Database=examen ;Trusted_Connection=Yes"any one who knows what could be the difficulty
View Replies !
Preventing error message message messages being displayed  (9 Views)
Originally placed by : Karsten ( am using the connection run property. If a run statement fails (i.E. stored procedure name is wrong) the error message is displayed. How can I prevent this for creating my own error handler.
View Replies !
error message message in sql  (4 Views)
Originally placed by : stephen ( coding:SQL1 = "SELECT m_id m_email, m_subject, m_numReplies, m_entrydate FROM messages "SQL2 = SQL1 & "WHERE m_reply=-1 ORDER BY m_id DESC;"set rs = Server.CreateObject("aDODB.Recordset")connectme="DSN=feedbackDSN"rs.Open SQL2,connectme ---> line 30error mesg provide :Microsoft OLE DB Provider for ODBC Drivers error '80040e10' [Microsoft][ODBC Microsoft access Driver] Too few parameters. Expected 1. vote messagelist.asp, line 30 anyone have any idea what is wrong Pls assist
View Replies !
Database error message message trapping.  (4 Views)
Originally placed by : John ( anybody have any idea how can i capture sql error message & then replace it wif the error created by asp so that user will know what it mean by the easy language instead of sql error.Thanx.Ur assist is appreciated.
View Replies !
Spread transaction error message message  (11 Views)
Originally placed by : sabu ( I encountered this difficulty when tried to perform a spread transaction using link server. My aim was to connect 2 data base servers using TCP IP and transfer data. I was able to execute single queries using "linkserver.catelog. owner.table". But this message was shown when i tried to execute a stored procedure. The message was "The operation could not be performed since OLEDB provider SQLOLEDB does not support spread transactions. [OLE Database spread transaction error message]" The documentations about the spread transactions showed that SQLOLEDB do support spread transactions. Please forward ur valuable ideas.
View Replies !
bugs and stored procedures  (5 Views)
Originally placed by : Gulliver ( am working with stored procedures a set. Some of the storedprocedures are usingother stored procedures. When an error message occure I want the name of the procedure that caused the errorto be returned with the line number where the error occured. Is this possible in SQL-Server
View Replies !
Query error message message  (3 Views)

I have this query and its gives me an error message saying expected end of statementwhere F Name and L Name are the names of the fields
the error is at " "Code snippet:
SELECT [F Name] & " " & [L Name] & [S Name] aS FullName from Students
View Replies !
Syntax error message message  (3 Views)
I am attempting to execute a dbcc check on a database 'SHEDaT'. I have not ever done some thing like this but attempting to receive the syntax down.
View Replies !
Stored procedure error message message -scalar variable  (6 Views)

I receive this error message message "Must declare the scalar variable @LoginName ".. when I try to save this stored procedure.
I do not understand what's wrong. Thank u.
Code snippet:
CREaTE PROCEDURE dbo.StoredProcedure1
@LoginName nvarchar(25)
@LoginPass nvarchar(08)
Select Log_name,users.userfName,users.UserLname from logins INNER JOIN
USERS on Logins.Log_Name=@LoginName
View Replies !
Been awhile but assist Microsoft VBScript runtime error message message '800a01a8'  (9 Views)
I am getting a
Microsoft VBScript runtime error message '800a01a8'
Object required: "
This is the sql statement Maybe u can view what I can't
INSERT INTO Seminar ([thedate][city_state],[one],[2_or_more],[start],[end],[ce_info],[seatsavailble],[location],[seminarname],[associatedapprovCode],[trainingcode],[schedid]) VaLUES ('Jan 6,2006','den co','50','50','4am','8:30pm','ce-001',150,'anywhere','this is a test','071806 01 ','071806 01 071806 0','006');
Microsoft VBScript runtime error '800a01a8'
Object required: '' the code is as follows
strQ ="INSERT INTO Seminar ([thedate],[city_state],[one],[2_or_more],[start],[end],[ce_info],[seatsavailble],[location],[seminarname],[associatedapprovCode],[trainingcode],[schedid]) VaLUES ('"&TheDate&"','"&City_state&"','"&singleP&"','"&t wo_or_more&"','"&start&"','"&endtime&"','"&Ce_info &"',"&seats&",'"&Location&"','"&SeminarName&"','"& AssociateApprovalCode&"','"&TrainingCode&"','"&Sch edID&"');"
View Replies !