[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1:


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1:

  1. #1
    Join Date
    Jan 2006
    Posts
    2

    Exclamation [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1:

    Hi i am getting error like the below, can any one help me in this....


    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '='.
    /railwaysproject/local/bangalore/deletetn.asp, line


    <%@LANGUAGE="VBSCRIPT"%>
    <%
    const action_add="add"
    const action_view="view"
    const action_delete="del"
    const action_edit="edit"
    const validate_yes="y"
    const norecordselected=-9999
    %>
    <html>
    <LINK rel=stylesheet href=menu.css type=text/css>
    <script language=JavaScript src=content1.js></script>
    <script language=JavaScript src=menu.js></script>

    <!--#include file="database.asp"-->
    <!--#include file="adovbs.inc"-->
    <%
    'Main Processing loop
    sub main()
    dim straction
    dim blnisvalidation
    dim stn
    %>
    <body>
    <%
    tn=request("tn")
    set objrs=server.CreateObject("adodb.recordset")
    strsql="select * from sbcswrtds where tn=" & tn
    objrs.open strsql,objconn,3,3
    %>

    <table align="center">
    <tr><td height="25"><font size=3 face="Verdana, Arial, Helvetica, sans-serif" color="blue"><b>Are you sure to delete "<%=objrs("tn")%>"</b></font></td></tr>
    </table>

    <form name="form1" method=post action="deletetn1.asp" onSubmit="return validate();" >
    <p>
    <table align="center">
    <tr>
    <td></td>
    <td height="80">
    <input type="submit" name="submit1" value="Delete" ></td></tr>
    </table>
    </p>
    </form>

    </body>
    </html>
    <%
    end sub
    'Code begins executing here
    call main
    %>


    Regards,
    Thirulok..
    Last edited by thirulok; 01-25-2006 at 01:28 AM. Reason: Wrong title given

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    If tn is a string then you need to enclose it within single quotes:

    strsql="select * from sbcswrtds where tn='" & tn & "'"

    I'm assuming that this is the line where the error is occurring.
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

Similar Threads

  1. find version & service packs
    By rperez in forum Database
    Replies: 5
    Last Post: 01-02-2009, 04:14 PM
  2. Replies: 0
    Last Post: 04-29-2002, 07:39 AM
  3. Replies: 1
    Last Post: 07-17-2001, 01:39 AM
  4. Access to SQL server
    By Nate in forum Database
    Replies: 29
    Last Post: 05-09-2001, 10:04 AM
  5. Replies: 0
    Last Post: 11-20-2000, 05:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center