Connecting Tech Pros Worldwide Help | Site Map
Reply
 
LinkBack Thread Tools Search this Thread
  #1  
Old September 10th, 2008, 06:53 PM
Newbie
 
Join Date: Sep 2008
Posts: 6
Default Microsoft VBScript runtime error '800a01a8'

Hi folks,

I am a bit new to asp, and I am trying to get my form to write to an Access DB and send a confirmation email to the user when they submit the form.

I am getting this error:

[BMicrosoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xe34 Thread 0xac0 DBC 0xd03c00c Jet'.

/formaction.asp, line 55
[/b]

Here is my code:

Expand|Select|Wrap|Line Numbers
  1. #51 <%
  2. #52 Dim conn, rs 
  3. #53 Set conn=Server.CreateObject("ADODB.Connection")
  4. #54 Set rs=Server.CreateObject("ADODB.Recordset")
  5. #55 conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/default4.mdb"
  6. #57
  7. #58 rs.Open "default4.mdb", conn, 2, 3
  8. #59 rs.addnew
  9. #60 rs("inputname")=Request.Form("Name")
  10. #61 rs("inputname")=Request.Form("Email")
  11. #62 rs("inputname")=Request.Form("Title")
  12. #63 rs("inputname")=Request.Form("Dealership")
  13. #64 rs("inputname")=Request.Form("Feb23_Reception")
  14. #65 rs("inputname")=Request.Form("Feb24_Business_Meetings")
  15. #66 rs("inputname")=Request.Form("Feb24_AB_VIP_Tour")
  16. #67 rs("inputname")=Request.Form("Feb25_Business_Meetings")
I have a global.asa file, but I don't know enough .asp to make this work and I have been scouring the Internet for days.

Any wisdom, guidance and/or help would be greatly appreciated.

Thanks,

Jim
Reply
  #2  
Old September 11th, 2008, 09:22 AM
omerbutt's Avatar
Familiar Sight
 
Join Date: Nov 2006
Posts: 227
Default

hi Jim,
use this way and to connect to your access database and the connection string would be this one here
Expand|Select|Wrap|Line Numbers
  1. Set rs=Server.CreateObject("ADODB.Recordset")
  2. Set conn=Server.CreateObject("ADODB.Connection")
  3. conn="Provider=Microsoft.Jet.OLEDB.4.0; Data Source="&server.mappath("fpdb/default4.mdb")
  4. sql_string="select * from table;"
  5. rs.CursorType = 2
  6. rs.LockType = 3
  7. rs.open sql_string,conn,3
  8. rs.addnew
  9. rs.fields("inputname")=Request.Form("Name")
  10. rs.fields("inputname")=Request.Form("Email")
  11. rs.fields("inputname")=Request.Form("Title")
  12. rs.fields("inputname")=Request.Form("Dealership")
  13. rs.fields("inputname")=Request.Form("Feb23_Reception")
  14. rs.fields("inputname")=Request.Form("Feb24_Business_Meetings")
  15. rs.fields("inputname")=Request.Form("Feb24_AB_VIP_Tour")
  16. rs.fields("inputname")=Request.Form("Feb25_Business_Meetings")
  17. rs.update
  18. rs.close
  19.  
tell me if there is any error using this method its been 5 years i have known asp and i have tried all the ways and all the connection strings and this method was the only one that never gave me any problems ......NEVER
Regards,
Omer Aslam
Reply
  #3  
Old September 11th, 2008, 03:45 PM
Newbie
 
Join Date: Sep 2008
Posts: 6
Default

Hi Omer,

Thank you very much for your reply. I inserted your code, but I got a new error:

Microsoft JET Database Engine error '80040e14'

Syntax error in FROM clause.

/formaction.asp, line 58


Here is my complete code... I am trying to write to an Access db and generate a confirmation email to the registrant, in case I didn't mention it in my other post.

Expand|Select|Wrap|Line Numbers
  1. <%
  2. Set rs=Server.CreateObject("ADODB.Recordset")
  3. Set conn=Server.CreateObject("ADODB.Connection")
  4. conn="Provider=Microsoft.Jet.OLEDB.4.0; Data Source="&server.mappath("fpdb/default4.mdb")
  5. sql_string="select * from table;"
  6. rs.CursorType = 2
  7. rs.LockType = 3
  8. rs.open sql_string,conn,3
  9. rs.addnew
  10. rs.fields("inputname")=Request.Form("Name")
  11. rs.fields("inputname")=Request.Form("Email")
  12. rs.fields("inputname")=Request.Form("Title")
  13. rs.fields("inputname")=Request.Form("Dealership")
  14. rs.fields("inputname")=Request.Form("Feb23_Reception")
  15. rs.fields("inputname")=Request.Form("Feb24_Business_Meetings")
  16. rs.fields("inputname")=Request.Form("Feb24_AB_VIP_Tour")
  17. rs.fields("inputname")=Request.Form("Feb25_Business_Meetings")
  18. rs.fields("inputname")=Request.Form("CAT_Update")
  19. rs.fields("inputname")=Request.Form("NACD_Update")
  20. rs.fields("inputname")=Request.Form("Power_Systems")
  21. rs.fields("inputname")=Request.Form("CAT_Financial")
  22. rs.fields("inputname")=Request.Form("Product_Support")
  23. rs.fields("inputname")=Request.Form("CAT_Panel_Discussion")
  24. rs.fields("inputname")=Request.Form("CAT_Path_to_2010_Goals")
  25. rs.fields("inputname")=Request.Form("Rental_Used_Update")
  26. rs.fields("inputname")=Request.Form("Dealer_Breakout_Session")
  27. rs.fields("inputname")=Request.Form("Dealer_Best_Practices")
  28. rs.fields("inputname")=Request.Form("Best_Practices_Ideas")
  29. rs.fields("inputname")=Request.Form("Add_Topics")
  30.  
  31. rs.Update
  32. rs.MoveLast
  33. strId=rs("id")
  34.  
  35. rs.Close
  36. conn.Close
  37. Set rs=nothing
  38. Set conn=nothing
  39. Response.Write "ID#: " & strId
  40. %>
Thanks again for your reply.

Jim
Reply
  #4  
Old September 11th, 2008, 05:36 PM
Newbie
 
Join Date: Sep 2008
Posts: 6
Default

Let me update this line number to avoid any confusion...

Line 58 actually = rs.open sql_string,conn,3

I just caught that...

Thanks again,

Jim
Reply
  #5  
Old September 11th, 2008, 08:14 PM
DrBunchman's Avatar
Moderator
 
Join Date: Jan 2008
Location: Winchester, UK
Posts: 926
Default

Jim, there's a SQL syntax error in your SQL string. It looks pretty simple though so not sure what could be causing it - is "table" actually the name of your table?

Dr B
Reply
  #6  
Old September 11th, 2008, 08:37 PM
Newbie
 
Join Date: Sep 2008
Posts: 6
Default

Dr B,

The name of the table is Results. I changed to Results from table, and now I get this error:

Expand|Select|Wrap|Line Numbers
  1. ADODB.Recordset error '800a0cc1' 
  2.  
  3. Item cannot be found in the collection corresponding to the requested name or ordinal. 
  4.  
  5. /formaction.asp, line 60
Code for line 60 = rs.fields("inputname")=Request.Form("Name")

Thanks very much,

Jim

Quote:
Originally Posted by DrBunchman
Jim, there's a SQL syntax error in your SQL string. It looks pretty simple though so not sure what could be causing it - is "table" actually the name of your table?

Dr B
Reply
  #7  
Old September 11th, 2008, 09:11 PM
DrBunchman's Avatar
Moderator
 
Join Date: Jan 2008
Location: Winchester, UK
Posts: 926
Default

Jim,

Then there is no column called "inputname" in your table Results. Make sure that all the fields that you are trying to update exist in your table and are spelt correctly.

Hope this helps,

Dr B
Reply
  #8  
Old September 12th, 2008, 04:27 PM
Newbie
 
Join Date: Sep 2008
Posts: 6
Default

OK, thanks DrB... I think I am getting close... here is my current code:

Expand|Select|Wrap|Line Numbers
  1. <%
  2. Set rs=Server.CreateObject("ADODB.Recordset")
  3. Set conn=Server.CreateObject("ADODB.Connection")
  4. conn="Provider=Microsoft.Jet.OLEDB.4.0; Data Source="&server.mappath("fpdb/default4.mdb")
  5. sql_string="select * from [Results]"
  6. rs.CursorType = 2
  7. rs.LockType = 3
  8. rs.open sql_string,conn,3
  9. rs.addnew
  10. rs.fields("Name")=Request.Form("Name")
  11. rs.fields("Email")=Request.Form("Email")
  12. rs.fields("Title")=Request.Form("Title")
  13. rs.fields("Dealership")=Request.Form("Dealership")
  14. rs.fields("Feb23_Reception")=Request.Form("Feb23_Reception")
  15. rs.fields("Feb24_Business_Meetings")=Request.Form("Feb24_Business_Meetings")
  16. rs.fields("Feb24_AB_VIP_Tour")=Request.Form("Feb24_AB_VIP_Tour")
  17. rs.fields("Feb25_Business_Meetings")=Request.Form("Feb25_Business_Meetings")
  18. rs.fields("CAT_Update")=Request.Form("CAT_Update")
  19. rs.fields("NACD_Update")=Request.Form("NACD_Update")
  20. rs.fields("Power_Systems")=Request.Form("Power_Systems")
  21. rs.fields("CAT_Financial")=Request.Form("CAT_Financial")
  22. rs.fields("Product_Support")=Request.Form("Product_Support")
  23. rs.fields("CAT_Panel_Discussion")=Request.Form("CAT_Panel_Discussion")
  24. rs.fields("CAT_Path_to_2010_Goals")=Request.Form("CAT_Path_to_2010_Goals")
  25. rs.fields("Rental_Used_Update")=Request.Form("Rental_Used_Update")
  26. rs.fields("Dealer_Breakout_Session")=Request.Form("Dealer_Breakout_Session")
  27. rs.fields("Dealer_Best_Practices")=Request.Form("Dealer_Best_Practices")
  28. rs.fields("Best_Practices_Ideas")=Request.Form("Best_Practices_Ideas")
  29. rs.fields("Add_Topics")=Request.Form("Add_Topics")
  30.  
  31. rs.Update
  32. rs.MoveLast
  33. strId=rs("id")
  34.  
  35. rs.Close
  36. conn.Close
  37. Set rs=nothing
  38. Set conn=nothing
  39. Response.Write "ID#: " & strId
  40. %>
*Line 86 = Line 36 here

However, now I am getting this error:

Microsoft VBScript runtime error '800a01a8'

Object required: 'Provider=Microsoft.J'

/formaction.asp, line 86


Thanks for all your help!

Jim


Quote:
Originally Posted by DrBunchman
Jim,

Then there is no column called "inputname" in your table Results. Make sure that all the fields that you are trying to update exist in your table and are spelt correctly.

Hope this helps,

Dr B
Reply
  #9  
Old September 15th, 2008, 09:04 AM
omerbutt's Avatar
Familiar Sight
 
Join Date: Nov 2006
Posts: 227
Default

just remove Conn.close from your code you dont need to close the connection ,you already closing the recordset so its okay
Reply
  #10  
Old September 17th, 2008, 03:59 PM
Newbie
 
Join Date: Sep 2008
Posts: 6
Default

That did it! Thanks very much for all your help...:)

Jim
Quote:
Originally Posted by omerbutt
just remove Conn.close from your code you dont need to close the connection ,you already closing the recordset so its okay
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 204,687 network members.
Post your question now . . .
It's fast and it's free

Popular Articles