Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2002
    Location
    Isrsel
    Posts
    4

    Smile Unanswered: error handling vbscript via sqlserver

    Hi,

    I wrote a small vbscript that sends information from a local computer to SQL server.
    The method I use for connecting to the SQL server is via ODBC DSN.
    This scripts runs on a DMZ located machine, while the SQL server is inside our LAN.

    All works fine, but when the network connection between DMZ machine and SQL server lost
    for a min. I receive an error.

    I monitored the error and tried to error handle it.

    after network is back the script is still on, but the error still there.


    this is the part where I get the error:

    ---------------------------------------------------------------------------
    Public function reso(byval res)

    'error 3705 occurs here

    objConn.Open strConn


    Set objrs = objconn.Execute("exec cmp_creation "& Computer &"," & res)


    objConn.Close


    end function
    ---------------------------------------------------------------------------

    Help would be much appreciated

  2. #2
    Join Date
    Dec 2002
    Posts
    1,245

    Re: error handling vbscript via sqlserver

    Why not use a DSN-less connection?

    Also, if the server is in your DMZ and the SQL Server is behind a firewall (assumed), I would be sure to use the IP address instead of the network name.

    Regards,

    hmscott

  3. #3
    Join Date
    Sep 2002
    Location
    Isrsel
    Posts
    4
    I'm not sure about the DSN-Less connection..... what would it change regarding my problem? also, what port do I have to open for a DSN-Less connection?

  4. #4
    Join Date
    Dec 2002
    Posts
    1,245
    I don't think that there's anything really wrong with a DSN connection and I'm not positive it would rectify your particular issue. However, DSN connections leave "footprints" on the server in your DMZ (in the registry) which are potentially vulnerable.

    DSN and DSN-less connections use the same ports to connect to their respective data sources. Thus, a DSN connection to SQL Server would use port 1433 as would a DSN-less connection.

    In general (from what I understand), DSN-less connections are "lighter" on the server, incurring less memory overhead. They are not, however, necessarily faster.

    In your script, do you check for the state of the connection? Is it just opened once and left open? Or is it opened and closed as necessary?

    Regards,

    hmscott

    Originally posted by eransp
    I'm not sure about the DSN-Less connection..... what would it change regarding my problem? also, what port do I have to open for a DSN-Less connection?

Posting Permissions

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