六月 21, 2007 at 12:13 上午
由 Kim Chow · Filed under C, Pgsql, 数据库, 编程
好。。在连接postgresql时,如果用ADO或是ODBC连接的话,资料就很多了,其实用代码也没多少。只是要注意的一些小细节会折磨人很久噢。。 下载postgresql就不说了,我用的是8.0版本。在安装时,如果是软件运行的目标机器,那么,就不用选择develop选项中的组件了,如果是开发的话,你就保证其中的“include”和“lib”文件夹的组件被选中(安装过程一定要注意,因为界面会弹出很多对话框的),如果你是第二次在同一台机器上安装多次的话,有可能会产生“the user have already existed”那么可以使用net user postgres /delete (如果选择的用户名是postgres的话);
Read the rest of this entry »
Permalink
五月 5, 2007 at 10:41 下午
由 Kim Chow · Filed under C, 编程
以前一直没有用过VC。这段时间跟着同事用VC做项目。说真的,学了不少东西。呵呵。。
起码搞清楚了系统托盘跟ADO连接MSsql以及连接用C api连接Mysql。呵呵。。
以前只会一些基本的C语句,现在也强不了多少。呵呵。。现在只会修改他们写的代码。自己还是写不出东西。
等这个项目结束之后,我好好地学些VC相关的。搞些简单的软件先。现在搞WEB已经没有什么好的突破点子了。
试一下用C/S加B/S的模式写些东西看。
Permalink
四月 24, 2007 at 3:58 下午
由 Kim Chow · Filed under C, 编程
关于Warning C4146:
一元负运算符应用于无符号类型,结果仍为无符号类型
无符号类型只能保存非负值,所以一元负(非)应用于无符号类型时通常无意义。操作数和结果都是非负的。
Read the rest of this entry »
Permalink
四月 24, 2007 at 9:02 上午
由 Kim Chow · Filed under C, 编程
MSDN上的解释为: You are trying to link with incompatible libraries. Important The run-time libraries now contain directives to prevent mixing different types. You’ll receive this warning if you try to use different types or debug and non-debug versions of the run-time library in the same program. For example, if you compiled one file to use one kind of run-time library and another file to use another kind (for example, single-threaded versus multithreaded) and tried to link them, you’ll get this warning. You should compile all source files to use the same run-time library. 总之,一句话,lib之间有冲突。需要删除导入的一些libs。
Read the rest of this entry »
Permalink
四月 24, 2007 at 8:55 上午
由 Kim Chow · Filed under C, 编程
VC++ 6.0 project settings for MySQL
Working Properly with VC++ 6.0 SP6. MySQL 5.0
win32 debug
C/C++:
code generation-> processor ->pentium
code generation-> Use run time librarty-> Multithreaded
optimizations-> Disable(Debug)
precompliled headers-> not using
Link:
Input->kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib libmysql.lib mysys-nt.lib regex.lib strings.lib zlib.lib
Input-> Ignore libraries: LIBCMTD.lib
Input-> Additional library path-> C:\Program Files\MySQL\MySQL Server 5.0\lib\opt
项目选项里,按上面的设置进行配置,代码方面跟Unix c使用C api差不多.
Permalink