no connect - redirect

Discussion in 'ASP General' started by shank, Jan 25, 2005.

  1. shank

    shank Guest

    How do I edit this so that if there's no connect, there's a redirect?
    thanks

    <%
    'REMOTE CONNECT STRING
    Set conn = Server.CreateObject("ADODB.Connection")
    conn.Provider = "sqloledb"
    conn.Properties("Data Source").Value = "sql38.com"
    conn.Properties("Network Library").Value = "dbmssocn"
    conn.Properties("Initial Catalog").Value = "mydb"
    conn.Properties("User ID").Value = "username"
    conn.Properties("Password").Value = "password"
    conn.open
    %>
     
    shank, Jan 25, 2005
    #1
    1. Advertising

  2. shank wrote:
    > How do I edit this so that if there's no connect, there's a redirect?
    > thanks
    >
    > <%
    > 'REMOTE CONNECT STRING
    > Set conn = Server.CreateObject("ADODB.Connection")
    > conn.Provider = "sqloledb"
    > conn.Properties("Data Source").Value = "sql38.com"
    > conn.Properties("Network Library").Value = "dbmssocn"
    > conn.Properties("Initial Catalog").Value = "mydb"
    > conn.Properties("User ID").Value = "username"
    > conn.Properties("Password").Value = "password"

    on error resume next
    > conn.open

    if err<>0 then response.redirect ...
    > %>


    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Jan 25, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Otis Mukinfus
    Replies:
    3
    Views:
    924
    Juan T. Llibre
    Jul 8, 2005
  2. Replies:
    3
    Views:
    40,284
    Roedy Green
    Nov 16, 2005
  3. Sal
    Replies:
    1
    Views:
    538
  4. Replies:
    2
    Views:
    288
  5. Mohsen Pahlevanzadeh

    Qt connect and first connect or unicode

    Mohsen Pahlevanzadeh, Sep 17, 2013, in forum: Python
    Replies:
    3
    Views:
    155
    Mohsen Pahlevanzadeh
    Sep 18, 2013
Loading...

Share This Page