-
Java + MS Access
I'm trying to insert dates from a JTextField onto an Acess database. It refuses to enter the date correctly , it either goes in as some garbage like "1.234756425" or "1993"
Can anyone help please? its driving me insane
-
The code is something like this
connection code here
Calendar cal = Calendar.getInstance();
Date today = cal.getTime();
SimpleDateFormat fmt =new SimpleDateFormat("MM-dd-yyyy");
String todayStr = fmt.format(today);
executequery("insert into table values("+todayStr+","+othervalue+")";
-
Well, if you already have debug your code then if the todayStr is holded the value that you wanted (a string value with a date format) than are you sure that the data type of your Access database field is also a date data type (ex: your field name is fldTodayDate and the data type is DateTime) ?
Similar Threads
-
By borceivanovski in forum Database
Replies: 0
Last Post: 04-26-2005, 05:35 PM
-
Replies: 0
Last Post: 05-16-2002, 09:54 AM
-
By Rafat balaom in forum VB Classic
Replies: 0
Last Post: 12-09-2001, 02:47 AM
-
Replies: 1
Last Post: 04-20-2001, 11:29 AM
-
Replies: 1
Last Post: 01-03-2001, 07:39 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks