Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Connection Problem


Message #1 by "Rick Agrella" <ricka@m...> on Wed, 17 Oct 2001 03:43:09
I am getting Access is Denied when i try to access my database. Im using 

windows 2000, and access 2000. There is no security set and i have tried 

the example in the Beginner book and the advanced book, tried using dns 

and still cannot get it. Here is my code:



<% 

	Dim adOpenForwardOnly, asLockReadOnly, adCmdTable

	adOpenForwardOnly = 0

	adLockReadOnly =1

	adCmdTable = 2



	Dim objConn, objRS

	Set objConn = Server.CreateObject("ADODB.Connection")

	Set objRS = Server.CreateObject("ADODB.Recordset")



	Dim strDatabaseType

	strDatabaseType = "Access"



	objConn.Open "Provider = Microsoft.Jet.OLEDB.4.0;" & _

		       "Data Source = c:\Inetpub\wwwroot\DB\subscribe.mdb"





	objRS.Open "Subscribe", objConn, adOpenForwardOnly,

        asLockReadOnly, asCmdTable



	While Not objRS.EOF

		Response.Write objRS("Email") & "<BR>"

		obj.MoveNext

	Wend



	objRS.Close

	objConn.Close

	Set objRS = Nothing

	Set objConn = Nothing



%>
Message #2 by Roger Balliger <Roger@i...> on Wed, 17 Oct 2001 09:10:58 -0700
Just by glancing at your code, I can tell it's riddled with spelling errors.

That is never any help when trying to debug a script. For example, your

variable names are misspelled everywhere especially adLock... and adCmd...

You seem to be spelling them like asLock... and asCmd.  So first, correct

all the misspellings, then run your code again. If it still doesn't work,

download a copy of the book example from wrox.com and run their code (making

sure their database is in the correct path). If theirs works, then you wrote

something wrong in your copy.  If theirs doesn't work, then your system may

be configured wrong.



Let us know.

Roger Balliger



Message #3 by "Ken Schaefer" <ken@a...> on Thu, 18 Oct 2001 18:32:10 +1000
: Just by glancing at your code, I can tell it's riddled with spelling errors.



Another reason to use Option Explicit <sigh>



Cheers

Ken




  Return to Index