User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 397,650 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,389 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:
Views: 3957 | Replies: 2
Reply
Join Date: Nov 2004
Posts: 4
Reputation: vexer007 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vexer007 vexer007 is offline Offline
Newbie Poster

Ms Access Help Please

  #1  
Nov 16th, 2004
Hi Peeps,

I am new to this forum, I am trying to create a weblog to allow users who are registered in a database I create in Access to create a blog entry which will be displayed on the screen to every one. I have created the database i Access and can manage some how using Dreamweaver to display contents of the database BUT THE QUESTION NOW IS, HOW DO I USE A FORM TO ENTER INFORMATION INTO THE DATABASE PLEASE! HELP ME AM DESPRATE.THANKS A MILLION... :-| :-|
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2003
Location: London, England
Posts: 281
Reputation: Roberdin will become famous soon enough Roberdin will become famous soon enough 
Rep Power: 7
Solved Threads: 6
Colleague
Roberdin Roberdin is offline Offline
Supreme Evil Overlord

Re: Ms Access Help Please

  #2  
Nov 19th, 2004
THere is a bult-in form creation wizard in Access. This will obviously limit data entry and retreival to one computer or possibly multiple clients on a LAN.

If you need remote Web Access as you imply, then you'll need something more complicated. Generally, Access is not good online as it's slow and cannot handle more than one request simultaneously. If you really want it, you can use it, but you should be aware that there are a raft of free database servers that are significantly faster online.
Reply With Quote  
Join Date: Jan 2005
Location: Sheffield, UK
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: Ms Access Help Please

  #3  
Jan 16th, 2005
I have been using asp and Access to create a forum (see www.basket2go.net/forum.asp). Scripts to add data to DB is listed below. Hope it may help:

' Get user name
ForumUser = Request.Form("user")
' re-structure the message in useable form
mssg = Trim(Request.Form("mssg"))
mssg = Server.HTMLEncode(mssg)
mssg = Server.URLEncode(mssg)
mssg = Replace(mssg, Chr(13), "<br>")
mssg = Replace(mssg, "'", "&acute;")
PostMssg = "<p class=bbody><b>" & ForumUser & "</b> <span class=stext>Posted on " & Now() & " GMT</span></p>"
PostMssg = PostMssg & "<p class=body>" & mssg & "</p><hr color=#EFEFEF>"

' check action
Select Case Request.Form("action")
Case "newpost"
' get the next PostID
Dim nDB, nRS, nSTR, nSQL
Set nDB = Server.CreateObject("ADODB.Connection")
set nRS = Server.CreateObject("ADODB.Recordset")
nSTR = "Driver={Microsoft Access Driver (*.mdb)};" & "dbq="&server.MapPath("db/dbForum.mdb") & ";"
nDB.Open nSTR
nSQL = "SELECT * FROM tblPost Order By PostID ASC"
SET nRS = nDB.Execute(nSQL)
While Not nRS.EOF
PostID = nRS("PostID")
nRS.MoveNext
WEND
PostID = CInt(PostID) + 1
PostTitle = Trim(Request.Form("title"))
' open database and add new record
nSQL = "Insert Into tblPost (PostID, PostDate, PostTitle, PostMssg)" &_
" Values ('"&PostID&"', '"&Now()&"', '"&PostTitle&"', '"&PostMssg&"')"
nDB.Execute nSQL
' Close and destroy all objects
nRS.Close
nDB.Close
Set nRS = Nothing
Set nDB = Nothing
' send user back to the forum he/she come from
Response.redirect "forum.asp"
Case "response"
' add response to existing forum
' open database to retrive existing message and number of replies
Dim rDB, rRS, rSTR, rSQL
' Open database for shopping cart
Set rDB = Server.CreateObject("ADODB.Connection")
set rRS = Server.CreateObject("ADODB.Recordset")
rSTR = "Driver={Microsoft Access Driver (*.mdb)};" & "dbq="&server.MapPath("db/dbForum.mdb") & ";"
rDB.Open rSTR
rSQL = "SELECT * FROM tblPost WHERE PostID = '"&Request.Form("id")&"'"
SET rRS = rDB.Execute(rSQL)
While Not rRS.EOF
PostReply = CInt(rRS("PostReply")) + 1
PostMssg = rRS("PostMssg") & PostMssg
rRS.MoveNext
WEND
' Close and destroy all objects
rRS.Close
Set rRS = Nothing
' update database with new data
rSQL = "Update tblPost SET PostDate = '"&Now()&"', PostMssg = '"&PostMssg&"', " &_
" PostReply = '"&PostReply&"' WHERE PostID = '"&Request.Form("id")&"'"
rDB.Execute rSQL
' Clean up
rDB.Close
Set rDB = Nothing
' send user back to the forum he/she come from
Response.redirect "forum_display.asp?id=" & Request.Form("id")
Case Else
' if not both cases, i.e. an error
Response.redirect "forum.asp"
End Select

Good luck.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MySQL Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 11:20 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC