SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Database connection from one server to another
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Ads
Starting Member

23 Posts

Posted - 07/19/2012 :  05:56:16  Show Profile  Reply with Quote
Hi,

I'm having trouble connecting to a database on another server. I have setup the DSN which in testing works perfect. However when running the asp script with the follwing code:

<%
Dim rsGetInvoiceContact
Dim rsGetInvoiceContact_numRows

Set rsGetInvoiceContact = Server.CreateObject("ADODB.Recordset")
rsGetInvoiceContact.ActiveConnection = MM_conn_to_EFACs_STRING_ap
rsGetInvoiceContact.Source = "SELECT * from "& ActinicPersons &" p WHERE p.[Contact ID] = " + Replace(rsGetInvoiceContact__vInvoiceID, "'", "''") + ""
rsGetInvoiceContact.CursorType = 0
rsGetInvoiceContact.CursorLocation = 2
rsGetInvoiceContact.LockType = 1
rsGetInvoiceContact.Open()

rsGetInvoiceContact_numRows = 0
%>

With the below connection string:

Dim MM_conn_to_EFACs_STRING_ap
MM_conn_to_EFACs_STRING_ap = "dsn=DSNefacsdb2;uid=IUSR_RFS01;pwd=Splendid01;"

The error show after running the script:

[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB provider 'MSDASQL' reported an error. The provider did not give any information about the error.

/Sales/order_entry.asp, line 55

When running the script against the local database it works as I want it, I have adjusted all the permissions on the other database for the user IUSR_RFS01, but still no joy! :(

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3328 Posts

Posted - 07/19/2012 :  07:08:14  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
Looks like the system doesn't like the sql you have sent it.
Could be something doesn't exist, the sql is wrong or your connection doesn't have permission on the objects.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000