Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: First step to work with SQL server, compared with MS Access


Message #1 by "Asami O.Meyers" <asamio@w...> on Sun, 27 May 2001 13:11:58
Hi, I have my site on host that supports, ASP, Access DB, and SQL server 

2000 on IIS 4.0.

I am new to datatabase stuff and ASP (a few months). But,  I can use 

simple ASP and SQL instruction enough to manipulate Access DB records

(insert, add, delete, modify)  and they work fine on host server.

I would like to be able to work with SQL server.  My host has a message 

says that "SQL server is much harder to use than Access DB, so if you are 

not familiar with SQL server you should use Access DB".  That message, and 

the fact that I don't have SQL server at home to play with (I have MS 

Access 2000 at home) kept me from attempting to try it. 



With Access DB, all I have to do with my host  is to give a DSN and FTP 

the database I want to work with. Then in ASP page, I use SQL, something 

like below, to manipute records like that. 



set conn = server.createobject("adodb.connection")

conn.Open "guestbook"

sqlstmt = "SELECT * from Guestbook ORDER BY PostDate DESC"

Set rs = Server.CreateObject("ADODB.Recordset")

rs.Open sqlstmt, conn, 3, 3

----

----



I guess my question is what else do I need to do to work with SQL server.  

I am guessing basic SQL instruction is the same, except the connection 

instruction. Am I right? 

I appreciate anybody who can guide me through the first step to work with 

SQL server.
Message #2 by "Gabriel de Figueiredo" <defigueiredog@l...> on Mon, 28 May 2001 06:28:00
You are right. The connect string is the one you should attack.  



Can you see the SQL Server box via MS-Query or MS-Access? if not, you will 

have to arrange for this first (check with your SQL Server administrator).



I use the following OLEDB connect string against a SQL7 database, and I 

daresay it could work against SQL2000: 



conn.open "Provider=SQLOLEDB.1;" & _

          "Data Source=<yoursqlservername>;" & _

          "Initial Catalog=<yourdatabasename>;" & _

          "Persist Security Info=False;" & _

          "Network=dbmssocn;" & _

          "User Id=<userid>;Password=<password>;"



The "network" string may need to be changed to "dbnmpntw" if you use named 

pipes instead of TCP/IP.  You will also require mdac2.1 or later to be 

loaded on your machine for OLEDB to work.  



A possible ODBC connect string would look like:



conn.open "DSN=<systemdsn>;" & _

	  "DATABASE=<databasename>;" & _

          "User Id=<userid>;Password=<password>;"



You will need to set up a system ODBC setting properly before using the 

connect string though.



Cheers.	



> Hi, I have my site on host that supports, ASP, Access DB, and SQL server 

> 2000 on IIS 4.0.

> I am new to datatabase stuff and ASP (a few months). But,  I can use 

> simple ASP and SQL instruction enough to manipulate Access DB records

> (insert, add, delete, modify)  and they work fine on host server.

> I would like to be able to work with SQL server.  My host has a message 

> says that "SQL server is much harder to use than Access DB, so if you 

are 

> not familiar with SQL server you should use Access DB".  That message, 

and 

> the fact that I don't have SQL server at home to play with (I have MS 

> Access 2000 at home) kept me from attempting to try it. 

> 

> With Access DB, all I have to do with my host  is to give a DSN and FTP 

> the database I want to work with. Then in ASP page, I use SQL, something 

> like below, to manipute records like that. 

> 

> set conn = server.createobject("adodb.connection")

> conn.Open "guestbook"

> sqlstmt = "SELECT * from Guestbook ORDER BY PostDate DESC"

> Set rs = Server.CreateObject("ADODB.Recordset")

> rs.Open sqlstmt, conn, 3, 3

> ----

> ----

> 

> I guess my question is what else do I need to do to work with SQL 

server.  

> I am guessing basic SQL instruction is the same, except the connection 

> instruction. Am I right? 

> I appreciate anybody who can guide me through the first step to work 

with 

Message #3 by "Tomm Matthis" <matthis@b...> on Mon, 28 May 2001 12:25:07 -0400
If you have Office 2000, then it comes with Microsofts Data Engine which is

SQL7 with some builtin limitations.. you can install and play with that and

learn about SQL.





-- Tomm



> -----Original Message-----

> From: Asami O.Meyers [mailto:asamio@w...]

> Sent: Sunday, May 27, 2001 1:12 PM

> To: ASP Databases

> Subject: [asp_databases] First step to work with SQL server, compared

> with MS Access

>

>

> Hi, I have my site on host that supports, ASP, Access DB, and SQL server

> 2000 on IIS 4.0.

> I am new to datatabase stuff and ASP (a few months). But,  I can use

> simple ASP and SQL instruction enough to manipulate Access DB records

> (insert, add, delete, modify)  and they work fine on host server.

> I would like to be able to work with SQL server.  My host has a message

> says that "SQL server is much harder to use than Access DB, so if you are

> not familiar with SQL server you should use Access DB".  That

> message, and

> the fact that I don't have SQL server at home to play with (I have MS

> Access 2000 at home) kept me from attempting to try it.

>

> With Access DB, all I have to do with my host  is to give a DSN and FTP

> the database I want to work with. Then in ASP page, I use SQL, something

> like below, to manipute records like that.

>

> set conn = server.createobject("adodb.connection")

> conn.Open "guestbook"

> sqlstmt = "SELECT * from Guestbook ORDER BY PostDate DESC"

> Set rs = Server.CreateObject("ADODB.Recordset")

> rs.Open sqlstmt, conn, 3, 3

> ----

> ----

>

> I guess my question is what else do I need to do to work with SQL

> server.

> I am guessing basic SQL instruction is the same, except the connection

> instruction. Am I right?

> I appreciate anybody who can guide me through the first step to work with

> SQL server.

> 

Message #4 by "Betty Harris" <psyche@o...> on Tue, 29 May 2001 09:36:54 -0500
Hi,



Someone wrote:

> I guess my question is what else do I need to do to work with SQL server.

> I am guessing basic SQL instruction is the same, except the connection

> instruction. Am I right?

> I appreciate anybody who can guide me through the first step to work

> with



The only difference I encountered (other than in establishing the

connection) is when using SQL Server, the query syntax is case sensitive

(Access doesn't care about case).



Betty




  Return to Index