473,403 Members | 2,338 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,403 software developers and data experts.

Insert data into access database

347 100+
I have the follwoing code that is trying to insert data into my yabel, the pages do not throw up any errors but i get nothing added to the database, has anyone got any ideas

Form Page
Expand|Select|Wrap|Line Numbers
  1. <form action="adddiary.asp" method="post">
  2. <table width="100%" cellpadding="0" cellspacing="0">
  3.   <tr>
  4.     <td width="6%" align="center"><input name="newinvoicenumber" type="text" size="10" maxlength="10"></td>
  5.     <td width="12%" align="center"><input name="newartistname" type="text" size="30" maxlength="50"></td>
  6.     <td width="10%" align="center"><input name="newtime" type="text" size="25" maxlength="25"></td>
  7.     <td width="11%" align="center"><input name="newstudio" type="text" size="25" maxlength="50"></td>
  8.     <td width="15%" align="center"><input name="newagency" type="text" size="40" maxlength="100"></td>
  9.     <td width="16%" align="center"><input name="newproduct" type="text" size="40" maxlength="100"></td>
  10.     <td width="14%" align="center"><input name="newproducer" type="text" size="40" maxlength="80"></td>
  11.     <td width="5%" align="center"><input name="newfee" type="text" size="6" maxlength="10"></td>
  12.     <td width="11%" align="center"><label for="select">Select State</label>
  13.       <select name="newstate" id="select" >
  14.         <option value="Pencil">pencil</option>
  15.         <option value="confirmed">confirmed</option>
  16.         <option value="message">message</option>
  17.         <option value="messageconfirmed">message confirmed</option>
  18.         <option value="email">email</option>
  19.         <option value="emailconfirmed">email confirmed</option>
  20.         <option value="txtconfirmed">text</option>
  21.       </select>
  22.       </td>
  23.   </tr>
  24.   <tr>
  25.   <td>
  26.   <input type="hidden" value="<% Response.Write(datetouse) %>" name="newdate">
  27.   <input type="submit">
  28.   </td>
  29.   </tr>
  30. </table>
  31. </form>
  32.  
insert page sql

Expand|Select|Wrap|Line Numbers
  1. <%
  2. On Error Resume Next
  3.  
  4. Response.Expires=0
  5. Set diaryConnection=Server.CreateObject("ADODB.Connection")
  6. DatabaseDetails="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("../../private/diary.mdb") & ";"
  7. diaryConnection.Open DatabaseDetails
  8. diaryQuery="INSERT INTO diary (invoicenumber, bookingdate, artistname, time, studio, agency, product, producer, fee, state) VALUES ('"&Request.Form("newinvoicenumber")&"', '"&Request.Form("newdate")&"', '"&Request.Form("newartistname")&"', '"&Request.Form("newtime")&"', '"&Request.Form("newstudio")&"', '"&Request.Form("newagency")&"', '"&Request.Form("newproduct")&"', '"&Request.Form("newproducer")&"', '"&Request.Form("newfee")&"', '"&Request.Form("newstate")&"')"
  9. Response.Write (diaryQuery)
  10. diaryConnection.execute(diaryQuery)
  11. %>
any ideas would be appreciated
May 9 '12 #1
1 2371
Nicodemas
164 Expert 100+
Get rid of the "On Error Resume Next" and rerun the script. If you have an error, it should display.
May 20 '12 #2

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

Similar topics

3
by: c676228 | last post by:
Hi all, I think I have data type problem when I tried to insert data into sql server 200. The erroe message is like this: system.invalidcastexception data type DFlage char(1) in sql 2000, DMI...
1
by: Doc11 | last post by:
I'm trying to allow users insert data into a database using the form view. But when I click the insert button I get this error: Server Error in '/Customer Database' Application....
1
by: rahia307 | last post by:
hi to all i want to use Aajx in php and want to insert data into database. but i have no idea about it. if any one have idea for it please help me
1
by: SuvarnaChaudhari | last post by:
Hi,Plz any one can tell me how to insert data in database through GridView,or there is no way,then plz tell me another way(I mean,should I use DetailView?but how?) Thaknk You!
7
by: evilash | last post by:
Hi, am new to c# so any help here would be greatly appreciated. Am trying to insert into my access database called Users.mdb located in my app data folder. My current code is as follows: ...
2
by: cday119 | last post by:
Can someone help me out with this one. I am trying to insert a row of data into an access database. The primary key is set to auto increment. It will work once but the next time you try an insert...
2
chathura86
by: chathura86 | last post by:
public void insertData(String sql) { if(conn != null) { SqlCommand cmd = new SqlCommand(); cmd.Connection = conn ; //setting the connection to sql command ...
3
by: bobbyze | last post by:
how to insert data into database using php with OOP structure
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.