我得sql语句如下:
CString strSQL ;
strSQL.Format("insert into gpssource (CarID, GpsDate1, x, y, Speed, fAngle, CarStatus) values (%d, '%s', %3.8f, %3.8f, %d, %d, %d)", dwMdtID, szTime, (double)dwLong/60000, (double)dwLati/60000, nSpeed, nDirection*2, bStatus);
我想要得到的是:insert into gpssource (CarID, GpsDate1, x, y, Speed, fAngle, CarStatus) values (17971, “10:16:02”, 121.42181667, 31.22610000, 0, 0, 3)
可是调试得到的是insert into gpssource (CarID, GpsDate1, x, y, Speed, fAngle, CarStatus) values (17971, 10:16:02, 121.42181667, 31.22610000, 0, 0, 3)
我哪里出错了?另外还有一个问题是我如何把当天的日期也加到szTime中?
CString strSQL ;
strSQL.Format("insert into gpssource (CarID, GpsDate1, x, y, Speed, fAngle, CarStatus) values (%d, '%s', %3.8f, %3.8f, %d, %d, %d)", dwMdtID, szTime, (double)dwLong/60000, (double)dwLati/60000, nSpeed, nDirection*2, bStatus);
我想要得到的是:insert into gpssource (CarID, GpsDate1, x, y, Speed, fAngle, CarStatus) values (17971, “10:16:02”, 121.42181667, 31.22610000, 0, 0, 3)
可是调试得到的是insert into gpssource (CarID, GpsDate1, x, y, Speed, fAngle, CarStatus) values (17971, 10:16:02, 121.42181667, 31.22610000, 0, 0, 3)
我哪里出错了?另外还有一个问题是我如何把当天的日期也加到szTime中?
解决方案 »
- XP 多桌面 运行一个程序
- 谁有管理图片的图片库吗,要带源代码的
- 有人研究过windows下socket描述符数字大小的规律吗?
- 牛人进来看看,关于“Understanding CControlView, Changing Scroll Bar Color in MFC Apps ”
- 请问如何通过程序查看机器的文件系统?并列出文件列表???
- 关于结构问题
- sendto和WSASendto,recvfrom和WSARecvfrom有什么区别?
- 验证时间放在哪里最好?
- VC6->新建工程->Utility Project是做什么用的?
- MFC 创建单文档视图框架程序,问题
- 求教用VC++读取PDF文件的方法
- 编译错误,小问题
oleTime.GetCurrentTime();
szTime=oleTime.Format();