Results 1 to 15 of 15
  1. #1
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Database Connect Error (2002)

    Perhaps it is privileges on the database (Access MDB, I assume). If you are using an external web host, you may need to change the privileges on the database or the folder in which it rests. I know this is true with 1&1 "Microsoft hosting." They provide a utility named WebFiles that lets you edit the permissions on the .mdb file to give the web server write access.

    Perhaps it is something else, but without replicating the whole setup, it's a challenge to debug...

    With respect to the built-in database features of FrontPage, it is true that they have some limits. Everyone graduates to writing their own ASP code sooner or later. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  2. #2
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Database Connect Error (2002)

    Hi!

    Thanks for the response. I didn't set any permissions / privileges to the database. Would this be something specific to the hosting site? I use ix webhosting.

    Re graduating to .asp...................................I've got the books all around me and yes I've been moving into that arena. God! It's as bad as learning Access LOL. And yes it is an Access database.

    Leesha

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Database Connect Error (2002)

    (Edited by HansV to make URL clickable - see <!help=19>Help 19<!/help>)

    Hi,

    I've been working for days trying to get the code from the following tutorial to work:
    http://www.frontpagehowto.com/newpassword/default.asp

    Everything related to the logon works fine. However if I go to try to register a user I get the following error:

    Database Results Error
    The operation failed. If this continues, please contact your server administrator.

    I've tested the database connection is the database result wizard and it shows that it connects. If I set up the registration form to enter the data directly into the database (vs using the registerentry.asp fomr) that connects and works as well.

    When I wrote to the author of the tutorial he stated that the error was related to the database not being able to be written to but that was all I heard from him. I'm now at a total loss and you wouldn't even imagine the hours I've spent at this.

    The reason I haven't used the FP connect directly to the database option is because I spent hours trying to get that to alert if there was a username already in use but nothing worked so I tried this appoach.

    Thanks!
    Leesha

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Database Connect Error (2002)

    <hr>I didn't set any permissions / privileges to the database. Would this be something specific to the hosting site?<hr>
    If you published your database solution initially from FrontPage (i.e., not through FTP), then FrontPage should have set the privileges for you. However, if you uploaded the database using FTP, normally it would be marked read-only and you have to manually allow the web server to make changes to it. That process is provider-specific.

  5. #5
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Database Connect Error (2002)

    Hi,

    I read somewhere about the read only situation being a possible issue but for the life of me couldn't tell if that was the case when I checked the properties as it didn't show me whether it was read only or not. Fortunately due to your help yesterday I contacted the company where I host my website and sure enough not only did I have to set up the ODBC info they have to do something from their end. It's been a painful learning experience but a good one. To think of the time I spent recoding things only to have the same result!

    Anyway, in my search for info and code I found a link to this group of Frontpage components which I decided to purchase and have been pleasantly surprised at how well they work, esp. the cookie piece and the verification of data in form fields.

    http://websunlimited.com

  6. #6
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Database Connect Error (2002)

    Hi,

    Well I've spent many more hours and days at this and have learned a great deal but am still nowhere at fixing my issue. I've tested the database on a site that I have hosted on 1and1 as well as ixwebhosting and each time I do to write to the database I get a "server error in / application". On 1and1 I wen into the webfile you suggested and set the permissions on the table to allow it to be written to but that didn't help. ixwebhosting state they have applied the correct settings but still it doesn't work. I rebuilt the page in Visual Web Develper 2005 (which I've come to love) and there are no errors on the pages. I changed the web.config file to point to the access database and when on the internet it reads the database fine but I can't write to it to add new files without the error. I haven't set any permissions etc. that should be limiting me. I don't know where to go next. As I said, I've learned a great deal which is good. I need to find the answer to this so I can move onto something new.
    The piece that has me stumped is that if I set up the page in frontpage to link to a database I can write to the database without any problems, but am limited by the FP code so this is why I want to create it from scratch. This tells me that the database isn't read/write protected. So what am I missing?
    Any ideas?
    Thanks,
    Leesha

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Database Connect Error (2002)

    Some thoughts:

    Do you use a security file? Its name may end with .mdw. If so, you need to account for this in your connection. Sample code for an Access 2000-format database:

    <hr><code>' Set up connection object and OLEDB string for local Access database
    Set objConnA = Server.CreateObject("ADODB.Connection")
    strConnectA = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & Server.MapPath("folderX/mydata.mdb") & ";" & _
    <span style="background-color: #FFFF00; color: #000000; font-weight: bold">"Jet OLEDB:System Database=" & Server.MapPath("folderX/mysecurity.mdw") & ";" & _</span hi>
    "User ID=abcdefg;Password=hijklmnop"
    ' Open the connection
    objConnA.Open strConnectA</code><hr>

    What is your code to write to the database? For example: adding a new record to a recordset or modifying an existing record?

    Sample add:

    <hr><code> ' Set up recordset and run query
    Set objRSA = Server.CreateObject("ADODB.Recordset")
    objRSA.Open "SpecialContact", objConnA, adOpenKeySet, adLockOptimistic, adCmdTable
    ' EOF checking removed for example
    ' Add new record to the recordset
    objRSA.AddNew
    ' Populate fields with form data and other stuff 'MOSTLY OMITTED FOR EXAMPLE
    objRSA("SpCnTimeAdded") = Now
    ' Save new record, close down database objects
    objRSA.Update
    objRSA.Close
    objConnA.Close
    </code><hr>

    Sample modify:

    <hr><code> ' Set up command (query) object
    Set objCommandA = Server.CreateObject("ADODB.Command")
    objCommandA.ActiveConnection = objConnA
    objCommandA.CommandType = adCmdText
    objCommandA.CommandText = _
    "SELECT * " & _
    "FROM SpecialContact " & _
    "WHERE SpecialContact.SpCnKey = Int('" & Request("SpCnKey") & "')"
    ' Set up recordset and run query
    Set objRSA = Server.CreateObject("ADODB.Recordset")
    objRSA.Open objCommandA, , adOpenKeyset, adLockPessimistic
    ' EOF checking removed for example
    objRSA("SpCnStatus") = "D" 'OTHER FIELDS DELETED FOR EXAMPLE
    objRSA.Update
    objRSA.Close
    objConnA.Close
    </code><hr>
    Does your code look about the same?

  8. #8
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Database Connect Error (2002)

    Hi,

    I haven't created a security file as I didn't want to do anything that was going to lock down this monster and keep it from writing. The code that was generated by Visual Web Designer is in the attached text file. I've also attached the web config file that is genereated by VWD and which shows the connection to Access.

    I hope this helps.

    Thanks,
    Leesha
    Attached Files Attached Files

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Database Connect Error (2002)

    Well, you've surpassed me here. You're generating ASP.Net, and I haven't started learning .Net yet. There's probably some plumbing that I don't see that connects these things together. ??

  10. #10
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Database Connect Error (2002)

    OHHHHHHHH NOOOOOOOOOOOOO! What will I do now. I have to say that I do absolutely love using VWD 2005. It's alot like using Access as well as Frontpage and for someone like me who is not strong in handcoding things, its awesome. Of course the big daaaaaaaaa for me is that I didn't realize there was a difference between asp and asp.net.

    I'm not sure about the piece that binds them. If I simple want to run / view the results of the query on the site that works fine. It is only when I go to edit a field or insert a field that it blows up and I get the error message. SOMETHING is prohibiting me from writing to the file and for the life of me I don't know what it is.

    Leesha

  11. #11
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Database Connect Error (2002)

    Leesha

    Jumping in late to the party here, Where is this application installed as it looks OK on the surface.

    Have you got the ASP.NET framework installed on the server that is housing this data.

    1) Start | Run | inetmgr
    2) Navigate to Default Website and Right Hand Mouse Click it
    3) Select Properties
    4) Is there an ASP.NET tab?
    Jerry

  12. #12
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Database Connect Error (2002)

    Hi Jerry!!

    I must really be tired because now I'm howling laughing! To think how far I've come since you first started working with me on how to deploy a swf file and yet I feel as lost as ever! I hope you guys are up to this. You are my only hope. I'm sure Han's is thrilled that this is not an Access issue LOL!

    OK, so I went to start/run/inetmgr and all I see are the files on my local computer not the actual webhosting sites. There is an ASP.net tab on my computer. I'm assuming you want me to see if there is one on 1and1 or ix?

    Praying I get this settled tonight so I sleep!!

    Leesha

  13. #13
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Database Connect Error (2002)

    Hi,

    I just checked with both 1and1 and ix and they both support asp.net 2.0. 1and1 doesn't support it linking to acces so that is most likely the root of my problem there. I'm not sure with ix. I really need to have it work with Access because trying to learn SQL as well as asp.net is more than I'm willing to take on at his point. Any thoughts?

    Leesha

  14. #14
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Database Connect Error (2002)

    I'm not sure you need to keep your database in Access format, unless you want to download it and work with it in Access.

    There is a built-in converter in Access to the SQL Server format. MS offers a bit of documentation here: Converting an Access Database with the Upsizing Wizard.

    I'm guessing that Visual Studio will handle all the other details once you import that database, but it's just a guess.

  15. #15
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Database Connect Error (2002)

    No its not so much that I have an Access Database that is already filled with data, its just that I'm familiar with Access and its property settings etc. and that is where my comfort zone is. Now I need to learn the parameters for SQL etc and although its something I know I need to get to I've been avoiding it.

    Leesha

Posting Permissions

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