Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: how do i connect to SQL database


Message #1 by "Christopher McBride" <camcbri@i...> on Fri, 11 Aug 2000 9:12:22
Hello!



I'm doing a project for my company and unfortunately (for me) they want all 

the databases in SQL server.  I don't have to make the database, the DB 

team is doing that for me.



All I really want to know is, how do I connect to it??  All of the examples 

are with access!  Can anyone tell me the lines to connect with the SQL 

server ole db native provider?  Also, are there any glaring differences 

between writing the SQL queries for access and SQL server?



Thanks a million for any help!

Message #2 by Biswajit <biswajit@v...> on Sat, 11 Aug 2001 02:33:47 +0530
This is the code for Connecting to SQL Server. Writing Queris will be more 

easy as you have already worked using

Access



Set objConn = CreateObject("ADODB.Connection")

Dim strConn

strConn = "Provider=SQLOLEDB; Data Source=td; Initial Catalog=pubs; User Id=sa; Password="



I thing the code below is used to connect to Access. If I am wrong then please help me

'strConn = "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=td; Initial Catalog=pubs; User Id=sa; Password="



objConn.Open strConn



With Regards

Biswajit





-----Original Message-----

From:	Christopher McBride 

Sent:	Friday, August 11, 2000 2:42 PM

To:	ASP Databases

Subject:	[asp_databases] how do i connect to SQL database



Hello!



I'm doing a project for my company and unfortunately (for me) they want all 

the databases in SQL server.  I don't have to make the database, the DB 

team is doing that for me.



All I really want to know is, how do I connect to it??  All of the examples 

are with access!  Can anyone tell me the lines to connect with the SQL 

server ole db native provider?  Also, are there any glaring differences 

between writing the SQL queries for access and SQL server?



Thanks a million for any help!



---

You are currently subscribed to asp_databases 






Message #3 by "Nick Middleweek" <nickm@t...> on Fri, 11 Aug 2000 13:01:07 +0000
Chris,



I can't see ther being much difference if any?



I've been using books that connec to Access and I've just coped the code and

it works for me.



You will have to set a DSN in ODBC control panels that points to your SQL

Server 7 db. That's what I'm using too. ASP to connect to it and also

another db environment calld 4th Dimension <http://www.4d.com> that I use as

a front end. - It's far better than FMpro.



I'd ge a book like SAMs teach yourself SQL Server 7 in 21 days or another

SQL book, but if you've been doing Access queries then I suppose you can do

most of that anyway unless you've relied on all the wizards?





HTH

Regards

Nick Middleweek







----------

>From: "Christopher McBride" 

>To: "ASP Databases" <asp_databases@p...>

>Subject: [asp_databases] how do i connect to SQL database

>Date: Fri, Aug 11, 2000, 09:12

>



> Hello!

>

> I'm doing a project for my company and unfortunately (for me) they want all

> the databases in SQL server.  I don't have to make the database, the DB

> team is doing that for me.

>

> All I really want to know is, how do I connect to it??  All of the examples

> are with access!  Can anyone tell me the lines to connect with the SQL

> server ole db native provider?  Also, are there any glaring differences

> between writing the SQL queries for access and SQL server?

>

> Thanks a million for any help!

>

> ---

> You are currently subscribed to asp_databases


> 

Message #4 by "Ken Schaefer" <ken@a...> on Sat, 12 Aug 2000 23:02:20 +1000
Nick,



Don't use ODBC! - especially for Access or other Jet data sources



http://www.adOpenStatic.com/FAQ/whyOLEBD.asp



Cheers

Ken



----- Original Message -----

From: "Nick Middleweek" <nickm@t...>

To: "ASP Databases" <asp_databases@p...>

Sent: Friday, August 11, 2000 11:01 PM

Subject: [asp_databases] Re: how do i connect to SQL database





> Chris,

>

> I can't see ther being much difference if any?

>

> I've been using books that connec to Access and I've just coped the code

and

> it works for me.

>

> You will have to set a DSN in ODBC control panels that points to your SQL

> Server 7 db. That's what I'm using too. ASP to connect to it and also

> another db environment calld 4th Dimension <http://www.4d.com> that I use

as

> a front end. - It's far better than FMpro.

>

> I'd ge a book like SAMs teach yourself SQL Server 7 in 21 days or another

> SQL book, but if you've been doing Access queries then I suppose you can

do

> most of that anyway unless you've relied on all the wizards?

>

>

> HTH

> Regards

> Nick Middleweek




  Return to Index