473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Connection using ASP

Hi,
I'm trying to use an asp page to send data from a basic HTML form to an Access database. I'm using GoDaddy hosting (which apparently many people have issues with when it comes to this) and here are my files:

form_ac.asp:
<%
' Declaring variables
Dim firstname, lastname, company, phone, email, data_source, con, SQLINSERT

' A Function to check if some field entered by user is empty
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function

' Receiving values from Form
firstname = ChkString(Request.Form("firstname"))
lastname = ChkString(Request.Form("lastname"))
company = ChkString(Request.Form("company"))
phone = ChkString(Request.Form("phone"))
email = ChkString(Request.Form("email"))
data_source = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\hosting\trehomes\access_db\TREAgents.mdb ;"


SQLINSERT="INSERT INTO TRE1 (FirstName, LastName, Company, Phone, Email) "


SQLINSERT=SQLINSERT & "VALUES ("
SQLINSERT=SQLINSERT & "'" & firstname & "', "
SQLINSERT=SQLINSERT & "'" & lastname & "', "
SQLINSERT=SQLINSERT & "'" & company & "', "
SQLINSERT=SQLINSERT & phone & ", "
SQLINSERT=SQLINSERT & "'" & email & "') "


' Creating Connection Object and opening the database
Set con = Server.CreateObject("ADODB.Connection")
con.Mode = 3 '3 = adModeReadWrite
con.Open data_source
con.Execute SQLINSERT

' Done. Close the connection
con.Close
Set con = Nothing
%>

And the form code:

<form action="form_ac.asp" method="post">
First Name<br />
<input name="firstname" type="text" /><br />
Last Name<br />
<input name="lastname" type="text" /><br />
Company<br />
<input name="company" type="text" /><br />
Phone Number<br />
<input name="phone" type="text" /><br />
Email<br />
<input name="email" type="text" /><br />
<input type="submit" name="Submit" value="Submit">
</form>

However, I keep getting the following error:

Microsoft JET Database Engine error '80004005'

Operation must use an updateable query.

/form_ac2.asp, line 35

According to GoDaddy, once you enable access db's for the site, any databases saved in access_db folder should have the proper permissions set. I'm thinking something might be wrong with the connection? Any help is GREATLY appreciated!!
Nov 17 '08 #1
1 1751
missinglinq
3,532 Expert 2GB
Since this concerns ASP code, with Access only providing the back end/data storage, I'm going to move it to the ASP forum, where it belongs.

Welcome to Bytes!

Linq ;0)>

Moderator
Nov 18 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: pradeep_TP | last post by:
Hi all, I have a few questions that I have been wanting to ask for long. These are all related to ADO.net and specifically to conenction to database. 1) If I have opened a connection to a...
35
by: Eric Sabine | last post by:
In my Finally block, I was using cn.close (where cn is an ADO.NET connection object, SQLConnection to be exact) and then I came across the following in some microsoft code. If Not cn Is Nothing...
35
by: Terry Jolly | last post by:
Web Solution Goal: Have a global database connection Why: (There will be 30+ tables, represented by 30+ classes) I only want to reference the database connection once. I put the connection...
10
by: Steven Blair | last post by:
As I understand it, if I create a connection object in my application and close the connection, the next time I open a connection with the same connection string I should be using a pooled...
16
by: crbd98 | last post by:
Hello All, Some time ago, I implemented a data access layer that included a simple connectin pool. At the time, I did it all by myself: I created N connections, each connection associated with...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
7
by: fniles | last post by:
I am using VB.Net 2003 and MS Access (connecting using OleDBConnection). I read using DataAdapter and DataSet, not DataReader. When many people try to access the database at the same time, I get...
3
by: fniles | last post by:
In the Windows application (using VB.NET 2005) I use connection pooling like the following: In the main form load I open a connection using a connection string that I stored in a global variable...
9
by: fniles | last post by:
I am using VB.NET 2003 and SQL 2005. To use connection pooling and avoid the error "There is already an open DataReader associated with this Connection which must be closed first." , I understand...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.