- 论坛徽章:
- 0
|
请教谁能做个有登陆界面的C源程序
根据你要联informix4的要求,需要esql做:
test.ec:
- #include<stdio.h>;
- $include sqlca;
- main()
- {
- $ char dbname[20],name[20],pass[20];
- $ int num;
- gets(name);
- gets(pass);
- sprintf(dbname,"%s",(char *)getenv("DBNAME"));
- $ database $dbname;
- num=0;
- $ select count(*) into $sum from operater where name=$name and pass=$pass;
- if(sqlca.sqlcode<0){
- printf("error in select count (%d)\n",sqlca.sqlcode);
- return(-1);
- }
- if(num==1)printf("OK!\n");
- else printf("FAIL\n");
- return(0);
- }
复制代码
编译:esql test.ec -o test |
|