Problems inserting a date into SQL Server 7.0 
Author Message
 Problems inserting a date into SQL Server 7.0

I am trying to insert a date into a table in my database
from a form. I am using sql server 7.0. The problem is
that when the date goes into the table it always changes
to the date 1/1/1900.
I am using the datatype 'date' in my front-end. When i
pass the variable into my sql statement it is the correct
date but when i view it in the databse it has changed.
But when i enter the date into the database directly and
then view it on the form it is the correct date.
Am i using the wrong datatype in my database or in VB?


Tue, 29 Jun 2004 02:00:56 GMT  
 Problems inserting a date into SQL Server 7.0
I don't think you use wrong datd type. You can stop the program before the
SQL statement was excuted, and check the exact value SQL string. If you use
like:

Conn.execute strSQL+"1/1/2002"

or Conn.execute strSQL+MyDate

You can change it to

Dim SQLString as String

SQLString=strSQL+MyDate

conn.Execute SQLString

Then check the exact value of SQLString. Also you can paste the string into
SQL Query Analyzer and execute it for test.

Luke

(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Fri, 02 Jul 2004 17:53:52 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Insert date type varible through ODBC SQL server driver to SQL 7.0 database

2. Date problems in Access and SQL server 7.0

3. Date problems in Access and SQL server 7.0

4. Date problems in Access and SQL server 7.0

5. inserting bmp in SQL Server 7.0

6. VB 3.0 with SQL SERVER 7.0 (Update, delete and Insert)

7. VB 3.0 with SQL SERVER 7.0 (Update, delete and Insert)

8. Problem on SQL-Update Statement with a Data-Control in VB 5 and SQL Server 7.0

9. Dates, VB6 and SQL Server 7.0

10. SQL Server 7.0 date handling with Crystal

11. Updating Dates in SQL-Server 7.0 Stored Proc thru VB.

12. Inserting date into sql server 6.5

 

 
Powered by phpBB® Forum Software