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
 SQL Server Development (2000)
 ASP vs. SQL

Author  Topic 

squall leonhart
Starting Member

4 Posts

Posted - 2006-04-07 : 21:17:39
I make this code but it errors about the login name.

<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>

<%
conn = ""Provider=sqloledb;Data Source=localhost;Initial Catalog=localhost;" + Server.Mappath="/aspProductCatalog/database/aspProduct_Data.mdf" + "User Id=squall leonhart;Password=;"

%>

<%
var rs, rs2, cn, msg

cn = Server.CreateObject("ADODB.Connection");
cn.Open(conn);
rs = Server.CreateObject("ADODB.Recordset");
sqlstring = "Select * From Admin"
rs.open(sqlstring, cn);

%>
==============
I used MSSQL Server 2000, login with Window authority. My admin name is Squall Leonhart, password is null.

Kristen
Test

22859 Posts

Posted - 2006-04-08 : 01:10:37
I still have a problem with the path to the database file that you have included in your connection string.

Did you try the examples in the website link I gave you when you asked before? i.e. http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=64348

Kristen
Go to Top of Page

squall leonhart
Starting Member

4 Posts

Posted - 2006-04-08 : 03:22:31
Yup! I made the correct path to the database but it announce error in the user id & password. The problem is it didn't connect with my login name & password I gave, although I use the Window authority default (My Window account name is Squall Leonhart & password is blank)
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2006-04-08 : 05:48:13
A connection string like that will use SQL accounts, not windows accounts.
Also, the mappath stuff is not necessary.

You need to go here and find a suitable connection string http://www.connectionstrings.com

Before you do anything else though, give yourself a password that isn't blank. In this age of spyware, worms and viruses, blank passwords are stupid.


Damian
"A foolish consistency is the hobgoblin of little minds." - Emerson
Go to Top of Page
   

- Advertisement -