Useing dbbind with Date/Time Fields 
Author Message
 Useing dbbind with Date/Time Fields

I have had great difficulty using dbbind to pull in date/time fields from
MS SQLServer.  I used the following syntax:

        dbbind(dbproc,18,SMALLDATETIBIND,(DBINT) 0, (BYTE *)
&dbdaAct_Start_Date_Time);

where dbdaAct_Start_Date_Time is a variable of type DBDATETIM4.

I am unable to put the value into a CTime variable for use in the program.
Is there any way to place the value in a usable date/time variable?
I am using Visual C++ 5 with ServicePack1.  If you can help please e-mail
me.

Forgive my ignorance
Kirt Phillips




Sat, 18 Mar 2000 03:00:00 GMT  
 Useing dbbind with Date/Time Fields

Whenever I have problems with types in the dblib, I just use character
arrays.  I can't remember the exact syntax since I haven't worked with
sybase in over 6 months.  This may not be the most elegant answer, but
it works.  You can bind to a character array, and then use that to
initalize the CTime variable.

If you're wondering about the sybase reference, sqlserver is just sybase
with a new face.  They are essentially the same except that if you know
sybase, sqlserver is really irritating.

kim

"If it's stupid, but works, it's not stupid"
                            - Murphy's Law

Quote:

> I have had great difficulty using dbbind to pull in date/time fields
> from
> MS SQLServer.  I used the following syntax:

>         dbbind(dbproc,18,SMALLDATETIBIND,(DBINT) 0, (BYTE *)
> &dbdaAct_Start_Date_Time);

> where dbdaAct_Start_Date_Time is a variable of type DBDATETIM4.

> I am unable to put the value into a CTime variable for use in the
> program.
> Is there any way to place the value in a usable date/time variable?
> I am using Visual C++ 5 with ServicePack1.  If you can help please
> e-mail
> me.

> Forgive my ignorance
> Kirt Phillips





Tue, 21 Mar 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Change date field type from long to Date/Time

2. Can't read time from Access 2000 date/time field

3. Date and time fields

4. Date/Time field in Access db

5. Update Access 2000 Date/Time field error

6. Find()ing Date/Time fields

7. Memory access violation using CRecordset and date/time fields

8. Date/Time Fields in ODBC

9. C time/date to Visual Basic time/date

10. Date Time Picker - Date AND Time

11. Reading and Writing to an OLE Object Field useing DAO

12. Reading and Writing to an OLE Object Field useing DAO

 

 
Powered by phpBB® Forum Software