View Full Version : Data is not store in my database file? why?
05-21-2007, 10:16 AM
i need some help here..
i am creating a website for my final project... which it is reservation system.. after i've key in all the data and click on submit button, it's link to another page... and then when i try open the database. whatever data i've keyed in earlier is not in the database files...
what should i do? help me..
im using windows XP , i've also installed IIS... and i've already set the the data source (ODBC ) ... what else should i have to set ?
05-21-2007, 01:11 PM
You'll need some code that takes the form contents and writes it to the database. Have you written this code? If so, can you post it up here?
05-22-2007, 08:54 AM
i've posted the code in this forum earlier, but no one help me or tell me.. what i've wrote is wrong..
can u check it and let me know about it.. thanks buddy...
05-22-2007, 10:38 AM
Well... it looks ok. You talk about setting up a DSN but you're connecting using a DSN-less connection, and there's an include file called "connection.inc" - that sounds database-related, and I don't know what's in it.
I don't like using recordsets to do database inserts. I don't see the point. Create an SQL string, get the connection to execute it directly. That way if it goes wrong you can at least write it out and see what you're actually telling the database.
For now... hmm. Not sure. You're not getting any sort of error message? Not even in the HTML source? (sometimes it gets hidden). Try adding:
immediately above the line:
Just to check that you're actually connecting to your database. You should get a "1". If you get a "0" or a "2", your database either isn't where you think it is, or isn't readable.
05-22-2007, 02:36 PM
You could cut your code in half if you used Request.form and an INSERT statement.
Since you are using Access, you don't need the Connection.inc file. Everything you need in Connection.inc is included in lines 18-22 posted below:
myconn.open "Provider=Microsoft.jet.oledb.4.0;data source=" & Server.MapPath("Hotel Reservation.mdb")
ssql="select * from Reservation"
The way that you are connecting to your database, it looks as though you need to supply a username and a password to access the database.
Do as Spudhead asked and response.write your Connection State.
If you get either a "0" or a "2", then check to make sure your Access database doesn't have a username and password associated with it.
If it does, change your connection string to:
myConn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("Hotel Reservation.mdb") & ";User Id=admin;Password=;"
myConn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("Hotel Reservation.mdb") & ";Jet OLEDB:Database Password=MyDbPassword;
where User Id == your username and Password == your password
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.