codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  I`M NEW HERE!! HELP!!!! Adding records to a Access Database!  nimalraj at 19:31 on Wednesday, October 01, 2003
 

Hi people, I'm new here and this is my first post!

I am looking for a tutorial that will show me how to set up a webpage that will allow me to add records to a access database.

I am tring to create a webpage that will allow users to enter some personal data. This information needs to go into a database.

How can I do this?

THank you in adavance!

  Re: I`M NEW HERE!! HELP!!!! Adding records to a Access Database!  Troy Wolf at 19:50 on Thursday, October 02, 2003
 

Here is some very basic code to get you started.

<%@ Language=VBScript %>

<%
Dim cnn, rs, sql
Dim id, name, age
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\temp\MyDatabase.mdb;")

'Insert a record
sql = "insert into employee (id, name, age) VALUES (100,'Troy Wolf',32)"
cnn.Execute(sql)

'Read a recordset
sql = "select id, name, age from employee order by name"
set rs = cnn.Execute(sql)
while not rs.EOF
id = rs.fields("id")
name = rs.fields("name")
age = rs.fields("age")
response.Write("Hi, " & name & "!" & vbcrlf)
rs.MoveNext
wend
rs.Close
set rs = Nothing
set cnn = Nothing
%>
Troy Wolf: site expert
Shiny Solutions









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  XML- Passing parameters are Latitude and Longitude.
•  Re: Format Date time issue....
•  Re: How to freeze the web page when displaying progress bar?
•  Re: Help! IFrames!
•  Re: Help: Trouble with z-Index and SELECT lists
•  Re: HOW CREATE LINE CHARTS IN ASP.NET
•  How to store and retrieve document into database
•  Re: text field multiple
•  Re: after updation of a table open another program .. need help


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005