Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Help conect to SQL

    Hi i need help with this code.

    Set conn1=Server.CreateObject("ADODB.Connection")
    conn1.ConnectionString="Provider=SQLOLEDB; Data Source=ASF_SQL; Initial
    Catalog=play4; User ID=viktors; Password=viktor"


    Set rsEmps=Server.CreateObject("ADODB.Recordset")
    strSQL="select
    p21_view_oe_hdr.order_no,p21_view_oe_pick_ticket.p ick_ticket_no,order_date,s
    hip2_name,ship2_add1,ship2_add2,ship2_city,ship2_s tate,ship2_zip,po_no,track
    ing_no,ship_date,name"
    strSQL=strSQL+"FROM dbo.address INNER JOIN dbo.p21_view_oe_pick_ticket ON
    dbo.address.id = dbo.p21_view_oe_pick_ticket.carrier_id LEFT OUTER JOIN
    dbo.p21_view_oe_hdr ON dbo.p21_view_oe_pick_ticket.order_no =
    dbo.p21_view_oe_hdr.order_no where p21_view_oe_hdr.order_no='105594'"
    rsEmps.Open strSQL, conn1, , , adCmdTable

    I an getting error:Error Type:
    ADODB.Recordset (0x800A0E7D)
    The connection cannot be used to perform this operation. It is either closed
    or invalid in this context
    inthe last line

    any help is greatful.


    viktor Guest

  2. Similar Questions and Discussions

    1. Window client conect to FMS installed Server
      Hello everybody! I used FMS 2 + Action Script2 for developing my application on window and it worked well. My application is Client-Server...
    2. Can't conect - access denied
      I recently changed hosting providers, and simply moved all of the files in my public_html folder over to my new public directory. However, when I...
    3. how to know FMS2 check client is not conect ?
      How to know Flash media server 2 check client is not connect( i have meet problem client fall net work but FMS2 is not know client is not connect )
    4. Can't conect to DB2 on iSeries (AS400)
      CF Administrator setup: CF Data Source Name metdb2 Database name of library I am trying to access on the...
    5. cannot conect the dots
      I am modifying text, I made the letter into points and cut it and moved parts, I know there is a way to connect the points of the pieces but cannot...
  3. #2

    Default Re: Help conect to SQL

    You don't have a conn.open anywhere.

    But, you could do this:

    strSQL="select
    p21_view_oe_hdr.order_no,p21_view_oe_pick_ticket.p ick_ticket_no,order_date,s
    hip2_name,ship2_add1,ship2_add2,ship2_city,ship2_s tate,ship2_zip,po_no,track
    ing_no,ship_date,name"
    strSQL=strSQL+"FROM dbo.address INNER JOIN dbo.p21_view_oe_pick_ticket ON
    dbo.address.id = dbo.p21_view_oe_pick_ticket.carrier_id LEFT OUTER JOIN
    dbo.p21_view_oe_hdr ON dbo.p21_view_oe_pick_ticket.order_no =
    dbo.p21_view_oe_hdr.order_no where p21_view_oe_hdr.order_no='105594'"


    Set conn1=Server.CreateObject("ADODB.Connection")
    conn1.Open "Provider=SQLOLEDB; Data Source=ASF_SQL; Initial Catalog=play4;
    User ID=viktors; Password=viktor"
    Set rsEmps = conn1.Execute(strSQL)


    Ray at work



    "viktor" <serguienkov@hotmail.com> wrote in message
    news:%23sh$5RpkDHA.372@TK2MSFTNGP11.phx.gbl...
    > Hi i need help with this code.
    >
    > Set conn1=Server.CreateObject("ADODB.Connection")
    > conn1.ConnectionString="Provider=SQLOLEDB; Data Source=ASF_SQL; Initial
    > Catalog=play4; User ID=viktors; Password=viktor"
    >
    >
    > Set rsEmps=Server.CreateObject("ADODB.Recordset")
    > strSQL="select
    >
    p21_view_oe_hdr.order_no,p21_view_oe_pick_ticket.p ick_ticket_no,order_date,s
    >
    hip2_name,ship2_add1,ship2_add2,ship2_city,ship2_s tate,ship2_zip,po_no,track
    > ing_no,ship_date,name"
    > strSQL=strSQL+"FROM dbo.address INNER JOIN dbo.p21_view_oe_pick_ticket ON
    > dbo.address.id = dbo.p21_view_oe_pick_ticket.carrier_id LEFT OUTER JOIN
    > dbo.p21_view_oe_hdr ON dbo.p21_view_oe_pick_ticket.order_no =
    > dbo.p21_view_oe_hdr.order_no where p21_view_oe_hdr.order_no='105594'"
    > rsEmps.Open strSQL, conn1, , , adCmdTable
    >
    > I an getting error:Error Type:
    > ADODB.Recordset (0x800A0E7D)
    > The connection cannot be used to perform this operation. It is either
    closed
    > or invalid in this context
    > inthe last line
    >
    > any help is greatful.
    >
    >

    Ray at Guest

  4. #3

    Default Re: Help conect to SQL

    Now I am gatting error:
    Error Type:
    Microsoft OLE DB Provider for SQL Server (0x80040E14)
    Line 1: Incorrect syntax near '.'.

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:uaODDVpkDHA.2964@tk2msftngp13.phx.gbl...
    > You don't have a conn.open anywhere.
    >
    > But, you could do this:
    >
    > strSQL="select
    >
    p21_view_oe_hdr.order_no,p21_view_oe_pick_ticket.p ick_ticket_no,order_date,s
    >
    hip2_name,ship2_add1,ship2_add2,ship2_city,ship2_s tate,ship2_zip,po_no,track
    > ing_no,ship_date,name"
    > strSQL=strSQL+"FROM dbo.address INNER JOIN dbo.p21_view_oe_pick_ticket ON
    > dbo.address.id = dbo.p21_view_oe_pick_ticket.carrier_id LEFT OUTER JOIN
    > dbo.p21_view_oe_hdr ON dbo.p21_view_oe_pick_ticket.order_no =
    > dbo.p21_view_oe_hdr.order_no where p21_view_oe_hdr.order_no='105594'"
    >
    >
    > Set conn1=Server.CreateObject("ADODB.Connection")
    > conn1.Open "Provider=SQLOLEDB; Data Source=ASF_SQL; Initial Catalog=play4;
    > User ID=viktors; Password=viktor"
    > Set rsEmps = conn1.Execute(strSQL)
    >
    >
    > Ray at work
    >
    >
    >
    > "viktor" <serguienkov@hotmail.com> wrote in message
    > news:%23sh$5RpkDHA.372@TK2MSFTNGP11.phx.gbl...
    > > Hi i need help with this code.
    > >
    > > Set conn1=Server.CreateObject("ADODB.Connection")
    > > conn1.ConnectionString="Provider=SQLOLEDB; Data Source=ASF_SQL; Initial
    > > Catalog=play4; User ID=viktors; Password=viktor"
    > >
    > >
    > > Set rsEmps=Server.CreateObject("ADODB.Recordset")
    > > strSQL="select
    > >
    >
    p21_view_oe_hdr.order_no,p21_view_oe_pick_ticket.p ick_ticket_no,order_date,s
    > >
    >
    hip2_name,ship2_add1,ship2_add2,ship2_city,ship2_s tate,ship2_zip,po_no,track
    > > ing_no,ship_date,name"
    > > strSQL=strSQL+"FROM dbo.address INNER JOIN dbo.p21_view_oe_pick_ticket
    ON
    > > dbo.address.id = dbo.p21_view_oe_pick_ticket.carrier_id LEFT OUTER JOIN
    > > dbo.p21_view_oe_hdr ON dbo.p21_view_oe_pick_ticket.order_no =
    > > dbo.p21_view_oe_hdr.order_no where p21_view_oe_hdr.order_no='105594'"
    > > rsEmps.Open strSQL, conn1, , , adCmdTable
    > >
    > > I an getting error:Error Type:
    > > ADODB.Recordset (0x800A0E7D)
    > > The connection cannot be used to perform this operation. It is either
    > closed
    > > or invalid in this context
    > > inthe last line
    > >
    > > any help is greatful.
    > >
    > >
    >
    >

    viktor Guest

  5. #4

    Default Re: Help conect to SQL

    I can't see why i am getting this
    Error Type:
    Microsoft OLE DB Provider for SQL Server (0x80040E14)
    Line 1: Incorrect syntax near '.'.

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:uaODDVpkDHA.2964@tk2msftngp13.phx.gbl...
    > You don't have a conn.open anywhere.
    >
    > But, you could do this:
    >
    > strSQL="select
    >
    p21_view_oe_hdr.order_no,p21_view_oe_pick_ticket.p ick_ticket_no,order_date,s
    >
    hip2_name,ship2_add1,ship2_add2,ship2_city,ship2_s tate,ship2_zip,po_no,track
    > ing_no,ship_date,name"
    > strSQL=strSQL+"FROM dbo.address INNER JOIN dbo.p21_view_oe_pick_ticket ON
    > dbo.address.id = dbo.p21_view_oe_pick_ticket.carrier_id LEFT OUTER JOIN
    > dbo.p21_view_oe_hdr ON dbo.p21_view_oe_pick_ticket.order_no =
    > dbo.p21_view_oe_hdr.order_no where p21_view_oe_hdr.order_no='105594'"
    >
    >
    > Set conn1=Server.CreateObject("ADODB.Connection")
    > conn1.Open "Provider=SQLOLEDB; Data Source=ASF_SQL; Initial Catalog=play4;
    > User ID=viktors; Password=viktor"
    > Set rsEmps = conn1.Execute(strSQL)
    >
    >
    > Ray at work
    >
    >
    >
    > "viktor" <serguienkov@hotmail.com> wrote in message
    > news:%23sh$5RpkDHA.372@TK2MSFTNGP11.phx.gbl...
    > > Hi i need help with this code.
    > >
    > > Set conn1=Server.CreateObject("ADODB.Connection")
    > > conn1.ConnectionString="Provider=SQLOLEDB; Data Source=ASF_SQL; Initial
    > > Catalog=play4; User ID=viktors; Password=viktor"
    > >
    > >
    > > Set rsEmps=Server.CreateObject("ADODB.Recordset")
    > > strSQL="select
    > >
    >
    p21_view_oe_hdr.order_no,p21_view_oe_pick_ticket.p ick_ticket_no,order_date,s
    > >
    >
    hip2_name,ship2_add1,ship2_add2,ship2_city,ship2_s tate,ship2_zip,po_no,track
    > > ing_no,ship_date,name"
    > > strSQL=strSQL+"FROM dbo.address INNER JOIN dbo.p21_view_oe_pick_ticket
    ON
    > > dbo.address.id = dbo.p21_view_oe_pick_ticket.carrier_id LEFT OUTER JOIN
    > > dbo.p21_view_oe_hdr ON dbo.p21_view_oe_pick_ticket.order_no =
    > > dbo.p21_view_oe_hdr.order_no where p21_view_oe_hdr.order_no='105594'"
    > > rsEmps.Open strSQL, conn1, , , adCmdTable
    > >
    > > I an getting error:Error Type:
    > > ADODB.Recordset (0x800A0E7D)
    > > The connection cannot be used to perform this operation. It is either
    > closed
    > > or invalid in this context
    > > inthe last line
    > >
    > > any help is greatful.
    > >
    > >
    >
    >

    viktor Guest

  6. #5

    Default Re: Help conect to SQL

    Do a
    Response.Write strSQL
    to see the actual query you are sending to the server. That should tell you
    where the problem is. If not, copy it off the browser window and paste it
    into Query Analyzer and try it there. You will probably get a better error
    message.


    viktor wrote:
    > I can't see why i am getting this
    > Error Type:
    > Microsoft OLE DB Provider for SQL Server (0x80040E14)
    > Line 1: Incorrect syntax near '.'.
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in
    > message news:uaODDVpkDHA.2964@tk2msftngp13.phx.gbl...
    >> You don't have a conn.open anywhere.
    >>
    >> But, you could do this:
    >>
    >> strSQL="select
    >>
    >
    p21_view_oe_hdr.order_no,p21_view_oe_pick_ticket.p ick_ticket_no,order_date,s
    >>
    >
    hip2_name,ship2_add1,ship2_add2,ship2_city,ship2_s tate,ship2_zip,po_no,track
    >> ing_no,ship_date,name"
    >> strSQL=strSQL+"FROM dbo.address INNER JOIN
    >> dbo.p21_view_oe_pick_ticket ON dbo.address.id =
    >> dbo.p21_view_oe_pick_ticket.carrier_id LEFT OUTER JOIN
    >> dbo.p21_view_oe_hdr ON dbo.p21_view_oe_pick_ticket.order_no =
    >> dbo.p21_view_oe_hdr.order_no where
    >> p21_view_oe_hdr.order_no='105594'"
    >>
    >>
    >> Set conn1=Server.CreateObject("ADODB.Connection")
    >> conn1.Open "Provider=SQLOLEDB; Data Source=ASF_SQL; Initial
    >> Catalog=play4; User ID=viktors; Password=viktor"
    >> Set rsEmps = conn1.Execute(strSQL)
    >>
    >>
    >> Ray at work
    >>
    >>
    >>
    >> "viktor" <serguienkov@hotmail.com> wrote in message
    >> news:%23sh$5RpkDHA.372@TK2MSFTNGP11.phx.gbl...
    >>> Hi i need help with this code.
    >>>
    >>> Set conn1=Server.CreateObject("ADODB.Connection")
    >>> conn1.ConnectionString="Provider=SQLOLEDB; Data Source=ASF_SQL;
    >>> Initial Catalog=play4; User ID=viktors; Password=viktor"
    >>>
    >>>
    >>> Set rsEmps=Server.CreateObject("ADODB.Recordset")
    >>> strSQL="select
    >>>
    >>
    >
    p21_view_oe_hdr.order_no,p21_view_oe_pick_ticket.p ick_ticket_no,order_date,s
    >>>
    >>
    >
    hip2_name,ship2_add1,ship2_add2,ship2_city,ship2_s tate,ship2_zip,po_no,track
    >>> ing_no,ship_date,name"
    >>> strSQL=strSQL+"FROM dbo.address INNER JOIN
    >>> dbo.p21_view_oe_pick_ticket ON dbo.address.id =
    >>> dbo.p21_view_oe_pick_ticket.carrier_id LEFT OUTER JOIN
    >>> dbo.p21_view_oe_hdr ON dbo.p21_view_oe_pick_ticket.order_no =
    >>> dbo.p21_view_oe_hdr.order_no where
    >>> p21_view_oe_hdr.order_no='105594'" rsEmps.Open strSQL, conn1, , ,
    >>> adCmdTable
    >>>
    >>> I an getting error:Error Type:
    >>> ADODB.Recordset (0x800A0E7D)
    >>> The connection cannot be used to perform this operation. It is
    >>> either closed or invalid in this context
    >>> inthe last line
    >>>
    >>> any help is greatful.


    Bob Barrows Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139