这是在vc6.0中实现的。我现在的错误是不能运行,就是windows弹出一个发送错误的那个对话框。
事先,你要在vc中tools--->options--->directories中把关于oci的inlcude和library的路径填写近去。
下面是代码:
其中mydb是我自己计算机中的一个数据库,并且在运行
===========================================
#include <stdio.h>
#include <stdlib.h>#include <oratypes.h>
#include <ocidfn.h>
#include <ociapr.h>
#include <ocidem.h>#pragma comment(lib,"C:\\oracle\\ora90\\oci\\lib\\msvc\\oci.lib")int main(int argc, char * argv[])
{
Lda_Def lda;
ub4 hda[HDA_SIZE/sizeof(ub4)]; text * user = (text *) "scott";
text * passwd = (text *) "tiger"; if(olog(&lda, (ub1 *) hda, user, -1,
passwd, -1, (text *) "mydb", -1, (ub4)OCI_LM_DEF ))
{
printf("login sucess.");
}    return 0;
}