sql database

Results 1 to 2 of 2

Thread: sql database

  1. #1
    Join Date
    Dec 1969

    Default sql database

    I have created database in sql server (i.e lakvacancy). I created login form for the user to enter user name and password. when user click submitt button, calling another file called loginrespond.asp here I am connecting the sql database and checking the user name and password exists in the table or not. <BR><BR>my code goes like<BR>fname=request.form("username")<BR>paswrd=r equest.form("password") <BR>db.Open "Provider=SQLOLEDB; Data Source=SERVER; Initial Catalog=lakvacancy; User ID=SA; Password="<BR>Set rsUsers = Server.CreateObject("ADODB.Recordset")<BR>strSQL = "SELECT * FROM lakuser WHERE login_id=&#039;" & fname & "&#039;" _<BR> & "AND pasword=&#039;" & paswrd & "&#039;;"<BR>rsUsers.CursorType = 2<BR>rsUsers.LockType = 3<BR>rsUsers.Open strSQL, db<BR>if rsUsers.recordcount&#060;&#062;0 then<BR><BR>after executing the file, I am getting the error as<BR>Microsoft OLE DB Provider for SQL Server (0x80004005)<BR>[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.<BR><BR>i could not locate the error, Please help me <BR>

  2. #2
    Join Date
    Dec 1969

    Default Did you *REALLY* use a blank password???

    MS warns you that you should use a blank password for the "sa" account. And, for that matter, you shouldn&#039;t really be using the "sa" account from ASP.<BR><BR>Anyway, *maybe* all you need it do pass a valid User ID *and* password in your OPEN line.<BR><BR>[This has NOTHING to do with your USER&#039;S id and password! Your code is NOT getting that far.]<BR><BR>Anyway, the message is both clear and correct: If you are sure that SQL Server *does* exist, then almost surely it is true that "access denied" is the problem.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts