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
 MSDE (2000)
 MSDE connection (Please help)

Author  Topic 

isheikh
Starting Member

25 Posts

Posted - 2004-02-01 : 09:38:52
Hi,

I installed MSDE from my MS office 2002 CD. Using MS access I created a project and then a database in MSDE. My question is when I connect to my datatbase, in my ASP code do I where I write the connection string do I put down the project name? or the database name? I noticed that the MSDE saved the project in the folder where i wanted but the database belong to that project is some other folder?

My second question is when you create MSDE database using Access as front end application is it possible to by pass the project and just make database straight?

Thanks

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2004-02-03 : 17:48:05
Hi isheikh

With Access 2002 (assuming you create a new project and not a .mdb file), the database is stored separately from the project file (as you noticed), so yes this means you can bypass the project file and access the database directly.

When you want to write asp code to access the database, don't bother trying to access the project. Your connection string should point directly to the database file.

For example, when I create a .adp file (project), I'm prompted to create a new database (adp1SQL by default). To connect from via ADO from an ASP page, the connection string will look something like this:

"Provider=sqloledb;Server=<COMPUTERNAME>;Database=adp1SQL;Trusted_Connection=no;UID=<UserName>;Pwd=<Password>"

PS - I can't actually create a new database from Access anymore (I have both MSDE and SQL Server EM loaded and it doesn't quite like that) - but this is how I connect to existing MSDE databases.

Let me know how you get on.

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page

isheikh
Starting Member

25 Posts

Posted - 2004-02-03 : 23:59:36
Hi ,

thanks for your reply. You know I just can not connect to MSDE from my ASP page and keep geting this error. When I installed MSDE i did not set the password and user name is still at default 'sa'

Error Type:
Microsoft OLE DB Provider for SQL Server (0x80004005)
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied


**********

My code is asp to connect is

objConn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=iffo;Data Source=local;Initial File Name=D:\Program Files\Microsoft SQL Server\MSSQL\Data\iffo.mdf"

************

I wrote this code exactly as it was given in this wrox book, only thing I am not sure here is that I don't know what that Catalog means, I am assuming it is also the name if the database


thanks
Go to Top of Page

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2004-02-04 : 00:32:56
yep, catalog is the name of the database. Try some variations on the Provider. As I said, I can't create databases from Access anymore to test it. Do you have the MSDE icon in the system tray? (little PC tower with a green arrow)?

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page
   

- Advertisement -