Click here to Skip to main content
15,892,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Problem reading Exif metadata Pin
David Crow17-Feb-11 14:36
David Crow17-Feb-11 14:36 
AnswerRe: Problem reading Exif metadata Pin
Niklas L17-Feb-11 19:53
Niklas L17-Feb-11 19:53 
Questionhow to sync google chrome bookmarks? Pin
yogish29317-Feb-11 0:07
yogish29317-Feb-11 0:07 
AnswerRe: how to sync google chrome bookmarks? Pin
phil.o17-Feb-11 0:59
professionalphil.o17-Feb-11 0:59 
GeneralRe: how to sync google chrome bookmarks? [modified] Pin
yogish29317-Feb-11 1:16
yogish29317-Feb-11 1:16 
GeneralRe: how to sync google chrome bookmarks? Pin
Richard MacCutchan17-Feb-11 4:48
mveRichard MacCutchan17-Feb-11 4:48 
GeneralRe: how to sync google chrome bookmarks? Pin
phil.o17-Feb-11 5:21
professionalphil.o17-Feb-11 5:21 
QuestionInserting Time into Sql Database.... [modified] Pin
AmbiguousName16-Feb-11 20:25
AmbiguousName16-Feb-11 20:25 
hello guys... im trying to store time in sql database using ADO. Now im using ctime() to get time and then send it as arguments in function to be stored. But it show the following error
Conversion failed when converting Datetime from character string
NOTE:Datatype of this column is DateTime in Sql Server. Here is my code to get time
char time1[60] = "";
time_t sTime;
time(&sTime);
strcat(time1,ctime(&sTime));
printf("the time is:\t %s", time1);

Database db;    //a class that I made inwhich I use ADO to handle database
db.InsertRec(time1); //

Now Here is the code for the function which inserts record in the database-----db.InsertRec()
char sTime[60] = "";
strcat_s(sTime,time1);
char query[100] = "INSERT INTO Tracks VALUES('";
strcat_s(query,sTime);
strcat_s(query,"')");
try
{
    recordset->Open(query, connection.GetInterfacePtr(),ADODB::adOpenForwardOnly,ADODB::adLockReadOnly,ADODB::adCmdText);
}
catch(_com_error &e)
{   printf("\n\n%s", (LPCSTR)((_bstr_t)e.Description()));   }
recordset->raw_Close();


what can be the problem?? thnx

modified on Thursday, February 17, 2011 2:38 AM

AnswerRe: Inserting Time into Sql Database.... Pin
Richard MacCutchan16-Feb-11 21:40
mveRichard MacCutchan16-Feb-11 21:40 
AnswerRe: Inserting Time into Sql Database.... Pin
ShilpiP16-Feb-11 21:54
ShilpiP16-Feb-11 21:54 
AnswerRe: Inserting Time into Sql Database.... Pin
Bernhard Hiller17-Feb-11 3:22
Bernhard Hiller17-Feb-11 3:22 
QuestionRegOpenKeyEx gets error 5 (ERROR_ACCESS_DENIED) Pin
Maxwell Chen16-Feb-11 16:21
Maxwell Chen16-Feb-11 16:21 
AnswerRe: RegOpenKeyEx gets error 5 (ERROR_ACCESS_DENIED) Pin
Cool_Dev16-Feb-11 19:02
Cool_Dev16-Feb-11 19:02 
GeneralRe: RegOpenKeyEx gets error 5 (ERROR_ACCESS_DENIED) Pin
Maxwell Chen16-Feb-11 19:50
Maxwell Chen16-Feb-11 19:50 
GeneralRe: RegOpenKeyEx gets error 5 (ERROR_ACCESS_DENIED) Pin
Cool_Dev16-Feb-11 20:13
Cool_Dev16-Feb-11 20:13 
GeneralRe: RegOpenKeyEx gets error 5 (ERROR_ACCESS_DENIED) Pin
Maxwell Chen17-Feb-11 16:24
Maxwell Chen17-Feb-11 16:24 
AnswerRe: RegOpenKeyEx gets error 5 (ERROR_ACCESS_DENIED) Pin
ShilpiP16-Feb-11 19:20
ShilpiP16-Feb-11 19:20 
GeneralRe: RegOpenKeyEx gets error 5 (ERROR_ACCESS_DENIED) Pin
Maxwell Chen16-Feb-11 20:03
Maxwell Chen16-Feb-11 20:03 
GeneralRe: RegOpenKeyEx gets error 5 (ERROR_ACCESS_DENIED) Pin
Richard Andrew x6417-Feb-11 11:55
professionalRichard Andrew x6417-Feb-11 11:55 
GeneralRe: RegOpenKeyEx gets error 5 (ERROR_ACCESS_DENIED) Pin
Maxwell Chen17-Feb-11 15:33
Maxwell Chen17-Feb-11 15:33 
GeneralRe: RegOpenKeyEx gets error 5 (ERROR_ACCESS_DENIED) Pin
ShilpiP17-Feb-11 17:39
ShilpiP17-Feb-11 17:39 
Questionstructure to file [REMAIN UNSOLVED] [CLOSED] Pin
goldenrose916-Feb-11 6:00
goldenrose916-Feb-11 6:00 
AnswerRe: structure to file Pin
Richard MacCutchan16-Feb-11 6:16
mveRichard MacCutchan16-Feb-11 6:16 
GeneralRe: structure to file Pin
goldenrose916-Feb-11 7:08
goldenrose916-Feb-11 7:08 
AnswerRe: structure to file Pin
David Crow16-Feb-11 7:56
David Crow16-Feb-11 7:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.