|
 |
access_asp thread: simple page to add a recond in Access
Message #1 by melvik2@y... on Thu, 16 Jan 2003 08:34:36
|
|
Dear List:
Please give me a simple example to add a record in Access DB via ASP.
Its urgent.
Im await & Thanks in advance,
Hovik.
Message #2 by "sashi dhar" <sashi@a...> on Thu, 16 Jan 2003 04:49:13 -0500
|
|
here is the ample program
<%@ Language=VBScript %>
<%
dim con,rs,sql
set con=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
'create table login in access
'with fields
'uid as text
'pwd as text
'create DSN 'hello'
con.Open "hello"
rs.Open "select * from login",con
while not rs.EOF
Response.Write rs.Fields("uid")
Response.Write("-")
Response.Write rs.Fields("pwd")
Response.Write("<br>")
rs.MoveNext
wend
%>
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
Meet Singles
http://corp.mail.com/lavalife
Message #3 by "sashidhar" <sashi@a...> on Thu, 16 Jan 2003 10:10:58
|
|
This is for adding into database
<%@ Language=VBScript %>
<%
dim con,rs,sql
set con=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
'create table login in access
'with fields
'uid as text
'pwd as text
'create DSN 'hello'
con.Open "hello"
con.Execute "insert into login values('abc','xyz') "
Response.Write "data inserted"
%>
Message #4 by "Carl E. Olsen" <carl-olsen@m...> on Thu, 16 Jan 2003 07:17:50 -0600
|
|
Set up a DSN or a connection string. You can use an UDL file to help
you create the connection string.
Dim strConnect
strConnect = "DSN=mydata"
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnect
Dim objRS, txtSQL
txtSQL = "SELECT * FROM table1"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open txtSQL, objConn, 3, 3
objRS.AddNew
objRS("fieldname1") = "stringtext"
objRS("fieldname2") = Request.Form("fieldname2")
objRS.Update
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
> -----Original Message-----
> From: melvik2@y... [mailto:melvik2@y...]
> Sent: Thursday, January 16, 2003 8:35 AM
> To: Access ASP
> Subject: [access_asp] simple page to add a recond in Access
>
> Dear List:
> Please give me a simple example to add a record in Access DB via ASP.
> Its urgent.
> Im await & Thanks in advance,
> Hovik.
> to unsubscribe send a blank email to leave-access_asp-
> 1112135Q@p...
|
|
 |