VB6 connect to SQL Db on a webserver

  • Hi

    Can I connect to a SQL 2000/2005 database on a webserver using a VB6 front end. The connection string I use to connect to a LAN server does not work. If this is possible, can someone please share the connection string. Thank you before hand

  • On testing the connection this is what I get

    Microsoft datalink error

    Login failed for user username

    Login failed. Catalog information cannot be retrieved.

  • This is how i connect to sql server using vb 6.0

    constr = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;"

    constr = constr + "Initial Catalog=master;"

    constr = constr + "Data Source=MyServerName"

    If cnn.State = adStateOpen Then cnn.Close

    cnn.Open constr

    where cnn is adodb.connection object

    Here i am using windows authentication to connect to the server. If you want to connect using sql authentication, you can remove integraged security part and add username and password clauses to the connection string.



    Pradeep Singh

  • yogesh.mankar (11/13/2009)


    On testing the connection this is what I get

    Microsoft datalink error

    Login failed for user username

    Login failed. Catalog information cannot be retrieved.

    You also need to add the Asp.net account into SQL Server and the database because all connection with Asp.net is resolved in IIS with the Asp.net user before your users, in Win2003 and up you could use the network service account.

    Kind regards,
    Gift Peddie

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply