Current location: Hot Scripts Forums » General Web Coding » HTML/XHTML/XML » Connection woth Access database?

Connection woth Access database?

Reply
  #1 (permalink)  
Old
New Member
 
Join Date: Aug 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Connection woth Access database?

I use dreamweaver MX and i need to create a registration page ive decided to create the page using HTML but converted it into JSP, ive created a simple test form that "should" allow a user to create a password and username. Ive also created a database using microsoft access 2000 just a simple one in design view and saved it. The problem im getting is i dont know how to connect the form to the database, i do know how ur meant to do it but i dont know how to define a connection with the database, any help ecept for telling me to use dreamweaver help or site because ive already looked.

Greatly appreciated Dan
Reply With Quote
  #2 (permalink)  
Old
Newbie Coder
 
Join Date: May 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
ok, let me see if I can help a little. I don't do any JSP programming so I can't help you there, but I do ASP. So, here is how I would do it.

Since you probably don't know what a global.asa is, we will just create a simple connection and then I will explain how to get your info into the database.

in the page where you have created the form. Make the action of the form = "". Doing this makes it so that if you submit the form, it sends the form info to the same page.

in the header of the page put this code

<%
''// Create a connection string to your database
Connectstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("yourAccessDatabase.mdb")

''// If the form has been submitted then grabe the data and save it
if Request.ServerVariables("REQUEST_METHOD") = "POST" then

''// Create a connection to your database
set cn = server.createobject("ADODB.Connection")
cn.Open Connectstring

''// Grab values from the form
Username = Request.Form("Username")
Password = Request.Form("Password")

''// Create sql statement to insert a record into the database
''// Replace caps with your correct info
''// insert into YOURTABLE (THE COLUMNS YOU ARE INSERTING) values (THE VALUES YOU WANT TO INSERT)

sql = "INSERT into tblYourTable (Username, Password) VALUES ('" & Username & "', '" & Password & "')"

cn.execute(sql)

set cn = nothing

end if
%>

This is very basic. It is tough to do online like this. Feel free to contact my via email if you want to learn a little more about asp. mikeirv@earthlink.net
Reply With Quote
  #3 (permalink)  
Old
adenoitz's Avatar
Newbie Coder
 
Join Date: Sep 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
server side

I think you need server side script to connect to the database. i think you can't connect to the database if use only html, or maybe you can use XML
In dreamweaver you can connect to the database by click the plus (+) button in databases tabs, on the application panel. you can use cutom connection string or use DSN. But you have to create your site first

Last edited by adenoitz; 09-24-04 at 03:33 AM.
Reply With Quote
Reply

Bookmarks


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
updating an Access database irajiii Windows .NET Programming 2 06-15-04 12:43 PM
Access Database Date Problem emvanlill Windows .NET Programming 2 05-10-04 03:06 AM
Coverting MS Access database to Text file sandeep_mankoo ASP 0 04-17-04 08:48 AM
2 questions 1-Webbased database access. 2-PDF data retrieval Mehre PHP 1 04-11-04 04:20 AM
Dreamweaver and access database Gian79 ASP 4 01-25-04 09:10 PM


All times are GMT -5. The time now is 06:57 PM.
vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.