SQL server connection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sheena81
    New Member
    • May 2007
    • 6

    SQL server connection

    hi,

    im new for sql server. im having a problem with connecting to sql server using asp. the coding that i have used for connection as below

    <%

    dim cn, rs
    set cn=server.Creat eObject("adodb. connection")
    cn.Open "Provider=SQLOL EDB;SERVER=serv er ip add;DATABASE=te stdata.mdf;UID= username;PWD=pa ssword;"
    set rs=server.Creat eObject("adodb. recordset")
    rs.open "Select productname from product where productID=22"

    rs.close

    %>

    <%=rs(productna me)%>

    the sql server that im trying to connect to is not in the same building. it's from other country. and could anyone provide me information, is there any way that i have to do setup in my pc....something like odbc setup or anything....

    thanks
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    I have moved this thread from the SQL Server forum to ASP.

    Comment

    Working...