Question Alarm Clock Database Help?

nicole200718

Active member
Joined
Feb 2, 2011
Messages
35
Programming Experience
Beginner
How can I put the time of what I set the alarm to to be in accessed from access 2007?
 

Attachments

  • Alarm Clock- Final Project 5-6-11.zip
    26.8 KB · Views: 38
Last edited by a moderator:
Are you asking how to store & retrieve data from a database? Or just how to specifically open an Access database?

For both questions, you'll need a connection string: Access 2007 Connection String Samples - ConnectionStrings.com
If you need help with getting data in and out of a database, there are tons of examples available via Google search.
Also, if you use an xsd file in your app, you can save a lot of time with the code for selecting, inserting, updating & deleting of data by having the designer generate the needed code for you.
 
Ok I understand how to put in the connection string an all but what do I put into my Microsoft access like a bunch of times or?? N the code I have that i attached will the database work with it and how besides a connection string is it going to work?
 
Well you will need to tell me how you want it to work, I personally would have a table with 4 fields: ID (Autoincrement), Enabled (True/False), Hour (Int), Minute (int) and using the xsd designer, have it create the connection string for me, and I would create the table and data adapter via a select sql statement, then I would put in an insert, update and delete statement for it, using pretty much just the defaults (nothing complicate) for the update & delete queries be sure to include the ID field in the where clause. Then in your form, just use the tableadapter & call the method you've named for each of the operations.
 
Like idk what I want it to really I guess just access the time or something through access 2007 and I'm using visual basic 2008 I am only requiredto do something with a database and I need to use either the dataReader or the command..
 
The TableAdapter object created in the xsd designer generates the DataReader code and everything behind the scenes for you, you simply call a method (it'll have the same name as what you name it in the designer) and pass it the field arguments it calls for (again, gotten from the query you specified) and it just does it for you, you don't need to get into the messy/dirty code of doing it yourself, just be sure to wrap the method calls in a Try/Catch as needed.
 
Step 1: Create your database (you might want to consider Access 2003 file format (Access 2010/2007 can save to the 2003 file format))
Step 2: Include the database in your app's solution
Step 3: Add a new item to the solution, select the Dataset (xsd) item
Step 4: Right click in the designer & select 'Add Table', using the wizard it'll ask you for a connection string, you can create it right here in the wizard
Step 5: Specify the query, there's a query designer available too, you're wanting to create a SELECT query, you'll even use this in the program later
Step 6: Give this a method name, you'll be calling this by name in your vb code
Step 7: In your vb code, declare a TableAdapter and DataTable object of the one's just created in the xsd file, the namespace is the same as the name of your xsd file, makes things easy for ya
Step 8: Use the TableAdapter object to call the select queries method name, passing it the parameters of which the DataTable object is going to be one of them

If you're still needing help by morning (it's 9:40pm EST) I can create a demo app that's similar to what you're needing for the alarm clock app and you can see how it works in code.
 
Well it's 8:44 central time here I have to have it turned in by 7:00 am in the morning can u send me a demo yet tonight please and thanks 4 the steps :)
 
ok so i started it but idk the hour, minute, and am/pm arent showing anything I need help I will send the attachment of what I got can you help me piece it together i tried but idk maybe i am doing it wrong?
 

Attachments

  • Alarm Clock- Final Project 5-6-11.zip
    43.7 KB · Views: 44
Sorry, I haven't had time to check the forum since my last post last night.

The designer opens when you open the xsd file, just like the form designer opens automatically when you open a form (not in code view of course) I'll whip up a quick example that has everything I've mentioned already in it so you can see.

And here's a quick and dirty example of what you're wanting.
 

Attachments

  • AlarmClock.zip
    44.1 KB · Views: 40
Back
Top