SQL database connectivity using ASP

Results 1 to 2 of 2

Thread: SQL database connectivity using ASP

  1. #1
    Vijay Guest

    Default SQL database connectivity using ASP

    I&#039ve the following code to create a SQL table using DSN and I&#039ve the following information regarding the server for a DSN connection:<BR> [MSSQL]<BR> DSN Name = abcde<BR> Username = abcdeif<BR> Password = abcde386<BR> Database Name = abcde<BR><BR> <BR>Code to create a table in SQL.....<BR> <BR>&#060;!-- #include virtual="adovbs.inc" --&#062;<BR><BR> &#060;%<BR> Dim sqlstr<BR> set cn = Server.createObject("ADODB.Connection")<BR> cn.open "DRIVER={SQL Server}; SERVER=????; UID=abcdef; DATABASE=abcde"<BR> sqlstr = "create table apidatabase1 (Sno numeric, CompanyName char(50), Address char(200), PhoneNo char(50), Location Char(20), "<BR> sqlstr = sqlstr & "Group1 Char(50), Website Char(50), Infosite Char(20), Email Char(50), Keywords Char(150), Industry Char(60), "<BR> sqlstr = sqlstr & "RawMat Char(60), Priority numeric, ContactPerson Char(60), DateofReg datetime, Products char(150), category char(50))"<BR> cn.execute sqlstr<BR> cn.close<BR> set cn = nothing<BR> <BR>%&#062;<BR> <BR>I want to know how to incorporate the server details in the above code so that I can create a table in SQL database in the web server? What will be the server name ? Where to mention the Password & the DSN name?

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL database connectivity using ASP

    If you&#039ve got a valid DSN then you don&#039t need any server details - the DSN takes care of them. Your connection line would be:<BR><BR>cn.Open "DSN=abcde;UID=abcdeif;PWD=abcde386"<BR><BR>Du nc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts