Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL database with ASP web page

Author  Topic 

pwint
Starting Member

7 Posts

Posted - 2004-12-01 : 22:47:46
I'm trying to connect ASP files with SQL database remotely with IP address. I wrote this connection string
<%
Dim conn,sqlstmt,sFname,sLanme,sPhone,sMemid

sMemid = request.Form("mem_id")

set conn=Server.CreateObject("ADODB.Connection")

conn.connectionstring = "server=xxx.xxx.x.x;uid=sa;initial catalog=MemberProfile;"
sqlstmt = "Select * from tmp_member where memberid= " & sMemid

set rsSelect= server.CreateObject("ADODB.recordset")
rsSelect.open sqlstmt, conn

sFname=rsSelect.fields("fname")
sLname=rsSelect.fields("lname")
sPhone=rsSelect.fields("phone")
sMembertype=rsSelect.fields("membertype")
sTitle=rsSelect.fields("title")
sDesignation=rsSelect.fields("designation")
sSection=rsSelect.fields("section1")
sOrganization=rsSelect.fields("orgname")
conn.execute(sqlstmt)
rsSelect.close
set rsSelect=nothing
conn.close
set conn=nothing
set sqlstmt=nothing
%>
xxx.xxx.x.x is IP address of the server that sql database and server stored. But when i run, this asp file, it doesn't work.How can i fix it? Thanks.

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2004-12-02 : 00:03:06
Use Server Name instead of IP address.
Go to Top of Page

pwint
Starting Member

7 Posts

Posted - 2004-12-02 : 02:34:08
I can't run with server name as the application(ASP)files are in one server and SQL database is in another server. I want to connect this database remotely not local.
Go to Top of Page
   

- Advertisement -