Example ASP in 21 days

Results 1 to 2 of 2

Thread: Example ASP in 21 days

  1. #1
    Frik Guest

    Default Example ASP in 21 days

    This i have copied from the book but i cannot get it to work<BR>Exercise 16 <BR><BR>Your help will be appreciated<BR>&#060;%@ Language=VBScript %&#062;<BR>&#060;% Option Explicit %&#062;<BR><BR>&#060;%<BR> &#039;Open up a connection to our Access database<BR> &#039;We will use a DSN-less connection.<BR> Dim objConn<BR> Set objConn = Server.CreateObject("ADODB.Connection")<BR> objConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};" & _<BR> "DBQ=d:winntProfilesAdministratorPersonalFriendsCo ntactInfo.mdb"<BR> objConn.Open<BR><BR> &#039;Create a recordset object instance and retrieve the information<BR> &#039;from the Friends table.<BR> Dim objRS<BR> Set objRS = Server.CreateObject("ADODB.Recordset")<BR> objRS.Open Friends, objConn, , , adCmdTable<BR><BR> &#039;Display the contents of the Friends table<BR> Do While Not objRS.EOF<BR> Response.Write "&#060;B&#062;" & objRS("Name") & "&#060;/B&#062;<BR>"<BR> Response.Write objRS("StreetAddress") & "<BR>"<BR> Response.Write objRS("City") & ", " & objRS("State")<BR> Response.Write "<BR>" & objRS("Zip") & "<BR>"<BR> Response.Write objRS("PhoneNumber") & "&#060;P&#062;&#060;HR&#062;&#060;P&#062;"<BR> <BR> &#039;Move to the next row in the Friends table<BR> objRS.MoveNext<BR> Loop<BR><BR><BR> &#039;Clean up our ADO objects<BR> objRS.Close<BR> Set objRS = Nothing<BR><BR> objConn.Close<BR> Set objConn = Nothing<BR>%&#062;<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80004005&#039; <BR><BR>[Microsoft][ODBC Microsoft Access 97 Driver] The Microsoft Jet database engine cannot open the file &#039;(unknown)&#039;. It is already opened exclusively by another user, or you need permission to view its data. <BR><BR>/Connect/DISPLA~1.ASP, line 11 <BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Example ASP in 21 days

    The first you need to check is:<BR>DO you have a "FriendsContactInfo.mdb" database ?<BR>If so, is it situated in "d:winntProfilesAdministratorPersonal\" folder ?<BR>Is so, How amny people are using your Database ?<BR>1.1 Just You ?<BR> 1.1.1 Then verify if you&#039;re datbase is "OPEN" in "design view" if it is, then close it.<BR> 1.1.2 If you say everything is close(I mean you Access Database) then verify if it has the correct permissions.<BR><BR>2.1 No not just me another people also are using the database ?<BR> 2.1.1 Ask them if one of them has the database open in "design view" if so ask him/her to close it<BR> 2.1.2 No none of them has the database open, go back to 1.1.2<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