If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > access SQL SERVER 2000 DB from an asp page

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-24-03, 10:18
srivalli9 srivalli9 is offline
Registered User
 
Join Date: Oct 2003
Posts: 32
access SQL SERVER 2000 DB from an asp page

Hi,

I'm using sql server 2000 database and trying to access it using asp.
when i installed sql server, i selected the mixed mode of authentication(windows and sql server).

but it gives me the following error.....
------------------------------------
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'sa'.
/rocky/basichits.asp, line 160
------------------------------------

i gave the uid and pwd as "sa" and "srivalli" respectively for the sql server itself.

my basichits.asp code looks like this....
---------------------------------
set c=server.CreateObject("adodb.connection")
c.Open "Driver={SQL Server};server=localhost;database=rmmlf;UID=sa;PAS S=srivalli"
---------------------------------

Could anyone please help me out with it?

thanks, in advance!!!!!!!!!
Reply With Quote
  #2 (permalink)  
Old 10-24-03, 15:43
vextout vextout is offline
Registered User
 
Join Date: Jan 2003
Location: New York
Posts: 160
double check your ODBC Connection
__________________
Beyond Limitation
Reply With Quote
  #3 (permalink)  
Old 10-24-03, 17:22
srivalli9 srivalli9 is offline
Registered User
 
Join Date: Oct 2003
Posts: 32
still a problem/........

thanks vextout....

my odbc is good, i guess.....i dont see any problem with it.!!!!!
moreover, i'm dynamically loading the driver as shown below...

---------------------------------
set c=server.CreateObject("adodb.connection")
c.Open "Driver={SQL Server};server=localhost;database=rmmlf;UID=sa;PAS
S=srivalli"
---------------------------------

could u tell me how to proceed?

thanks.
Reply With Quote
  #4 (permalink)  
Old 10-24-03, 18:40
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
I've never used "UID" and "PASS", but unstead "User ID" and "Password"

Example:
Code:
strConn="Provider=SQLOLEDB; Data Source=<servername>; Initial Catalog=<database name>; User Id=<sql user id>; Password=<sql user password>"
Might be worth a try...

As a side note, don't use "sa" for your web applications. Create a user and give it rights to only what is necessary. Otherwise you leave your entire system open and prone to hacks.
__________________
That which does not kill me postpones the inevitable.

Last edited by Seppuku; 10-24-03 at 18:45.
Reply With Quote
  #5 (permalink)  
Old 10-25-03, 11:29
srivalli9 srivalli9 is offline
Registered User
 
Join Date: Oct 2003
Posts: 32
thanks

hi vextout,
i would definitely try it out in my office on monday....
thanks a lot for the info.
Reply With Quote
  #6 (permalink)  
Old 10-27-03, 04:37
sreeraj sreeraj is offline
Registered User
 
Join Date: Oct 2003
Location: India
Posts: 55
Wink Asp Connection With Sql

Instead of connecting using a connection String use a DSN.

Create a DSN for your connection on the iis server machine,Test it then
use

Con.ConnectionString="DSN=DSNNAME"
Con.open


This should work

Try it out
__________________
Sree
Reply With Quote
  #7 (permalink)  
Old 10-27-03, 09:28
srivalli9 srivalli9 is offline
Registered User
 
Join Date: Oct 2003
Posts: 32
thanks all

thanks all very much!
my thing is working with a DSN name!!!!!
thanks again
Reply With Quote
  #8 (permalink)  
Old 10-27-03, 09:36
srivalli9 srivalli9 is offline
Registered User
 
Join Date: Oct 2003
Posts: 32
why only DSN?????

still wondering why always have a dsta source set up?
cant i load the driver dynamically and still get it working???

any ideas......

thanks a lot in advance.
Reply With Quote
  #9 (permalink)  
Old 10-28-03, 00:49
sreeraj sreeraj is offline
Registered User
 
Join Date: Oct 2003
Location: India
Posts: 55
Cool DSN

IT is not that it will work only with DSN.

Try building the Connection String using a ADODC data control and copy and paste the connectionstring .
So the matter is you have to have the correct connection string.

Thats all.

Regards
__________________
Sree
Reply With Quote
  #10 (permalink)  
Old 10-28-03, 09:29
srivalli9 srivalli9 is offline
Registered User
 
Join Date: Oct 2003
Posts: 32
Thanks sree

Hi sree...thanks...

but i still do not find anything wrong in my connection string.....
set c=server.CreateObject("adodb.connection")
c.Open "Driver={SQL Server};server=localhost;database=rmmlf;UID=sa;PAS
S=srivalli"

my sql server is in the machine where my iis server is running....so i put localhost.and my database name is rmmlf....when installing sql server, i used mixed authentication mode....and hence those id and password!!!

any idea where i'm mistaken?

thanks....
Reply With Quote
  #11 (permalink)  
Old 10-29-03, 06:28
sreeraj sreeraj is offline
Registered User
 
Join Date: Oct 2003
Location: India
Posts: 55
ASP ADO

Hi

As i said earlier just create a connection to your database using ADODC Data Control and compare it with your connection String.

Reards
__________________
Sree
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On