|
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!
|
|
|
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
%>
|
|
|
|
|
|
|
|
|
|
|
|