2

I use the below connection string to connect to a sqlserver 2008 located in another server. How to i connect to it from ASP using vbscript?

application("database_connectionstring_internal") = "DRIVER=SQL Server;SERVER=53.90.111.22;DATABASE=crm_cos;UID=cos_user;PASSWORD=1q2w3e4r5t"

Here are my server details :

Database server : Server IP - 53.90.111.22

Sql server name - SCD13B

User name - cos_user

password - 1q2w3e4r5t

Database name - crm_user

5
  • How do you connect to it using which technology? .Net, C++, Java, etc.? Commented Jun 1, 2011 at 6:36
  • 2
    Please, tell me your password is not really the one you wrote... do not publish passwords!!! Commented Jun 1, 2011 at 6:37
  • @Will A, i am using asp with vbscript Commented Jun 1, 2011 at 6:38
  • 1
    @Macra, Yeah i know. None of the info is real Commented Jun 1, 2011 at 6:39
  • 1
    @Anuya, @Macra - I can vouch for the information not being real - I tried to connect and got into the CIAs mainframe. What a disappointment. :p Commented Jun 1, 2011 at 6:40

3 Answers 3

1

Try --

Dim oConn
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Driver={SQL Server};Server=53.90.111.22;Database=crm_user;Uid=cos_user;Pwd=1q2w3e4r5t"
Sign up to request clarification or add additional context in comments.

Comments

0

I am using something like this:

C#

"Data Source=host's ip\\SQLEXPRESS;Initial Catalog=yourddbb;User ID=youruser;Password=yourpassword"

ASP 3.0

StrConex= ""
StrConex= StrConex & "Provider=SQLOLEDB.1;Password=yourpasswd;"
StrConex= StrConex & "Persist Security Info=True;User ID=youruser;"
StrConex= StrConex & "Initial Catalog=yourddbb;Data Source=host's ip\SQLEXPRESS"

Comments

0

You have two possibilities :

1 - Add connection string to your web.config as show in this post : "Using connection strings from web.config in ASP.NET v2.0"

2 -Add the connection to code-behind :

 Dim strConnect As String=”Data Source=localhost;Initial Catalog=pubs;Integrated Security=SSPI;” 

 Dim myConnection As SqlConnection=New SqlConnection(strConnect)

 MyConnection.Open()

1 Comment

Which doesn't help since the OP isn't using .net

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.