當前位置:首頁 » 編程軟體 » vc資料庫編程

vc資料庫編程

發布時間: 2025-03-28 09:43:36

資料庫編程需要什麼軟體,在哪下載

如果是用C1

1、TurbocDOS經典編譯軟體
2、Win-TC圖形化編譯軟體,其特點是容量小
3、VC++微軟體開發的,主要是用來弄C++的,不過因為他支持中文顯示,做為C的開發也很不錯
二、如果你是搞VB、VS等的你可以直接下載一個MicrosoftVisual集成,裡麵包含有VC++、VS、VB等編譯軟體
三、如果是要搞java
1、你如果自認為自己寫代碼很牛,那你就去下載個一java編譯器就行了,代碼用記事本寫2、不然你就去下載下JDK四、搞匯編的
1、Masm集成實驗環境還是很不錯的
五、搞網站開發的
(1)asp,把你的電腦IIS配置好,不用軟體,一個記事本一樣搞定
(2)php那你就得去下載Apache、php5.0、Mysql,一樣,代碼用記事本就能搞定,前軟體只是構建一個環境
(3)Drewawear應該少不了啦暫就這些

② 用C或C++編程實現資料庫的查詢,添加,刪除,修改功能。

一個教材管理系統,給你參考下
void shumingsearch(struct book *head) /*按教材名稱查找*/
{ struct book *p;
char name[20];
int c;
if(head==NULL) {printf("未打開任何文件");getchar();return;}
printf("1,查找專業 2,查找教材名稱:");
scanf("%d",&c);
getchar();
if(c==2)
printf("請輸入要查找的教材名稱:");

else printf("請輸入要查找的專業:");
gets(name);
p=head;
do{ if(c==2)
if(strcmp(p->shuming,name)==0)
{
printf("教材編號:%s\n教材名稱:%s\n數量:%d\n價格:%d\n專業:%s\n作者:%s\n出版社:%s\畢旦n備註:%s\n",p->number,p->shuming,p->shuliang,p->jiage,p->zhuanye,p->zuozhe,p->chubanshe,p->beizhu);

}
if(c==1)
if(strcmp(p->zhuanye,name)==0)
{
printf("教材編號:%s\n教材名稱:%s\n數量:%d\n價格:%d\n專業:%s\n作者:%s\n出版社:%s\n備註:%s\n",p->number,p->shuming,p->shuliang,p->jiage,p->zhuanye,p->zuozhe,p->chubanshe,p->beizhu);

}
p=p->next;
}while(p!=NULL);
printf("查找完成");
return;
}

struct book *add(struct book *head) /*增加記錄*/
{ struct book *p,*e,*f,*h;
if(head==NULL) {printf("未打開任何文件");getchar(); return NULL;}
h=f=e=head;

p=(struct book *)malloc(sizeof(struct book));
printf("\n教材編號:"慎薯);
gets(p->number);
printf("\n教材名稱:");
gets(p->shuming);
printf("\n數量:");
scanf("%d",&p->shuliang);
printf("\n價格:");
scanf("%d",&p->jiage);
getchar();
printf("\n專業:");
gets(p->zhuanye);
printf("\n作者:");
gets(p->zuozhe);
printf("\n出版社:");
gets(p->chubanshe);
printf("\n備注:");
gets(p->beizhu);

if(strcmp(f->number,p->number)>0) { p->next=f;h=p;printf("\n添加成功");return h;}
if(f->next==NULL) { f->next=p;p->next=NULL;printf("\n添加成功"手孝擾);return h;}
do{
if(f->next!=NULL)
if(strcmp(f->number,p->number)>0)
{
e->next=p;p->next=f;printf("\n添加成功");return h;
}

if(f->next==NULL)
{
f->next=p;
p->next=NULL;
printf("\n添加成功");
return h;
}

f=f->next;
e=e->next;
}while(1);
}

struct book *delet(struct book *head) /*刪除記錄*/
{ struct book *p,*e;
char num[20];
if(head==NULL) {printf("未打開任何文件");getchar();return NULL;}
printf("請輸入要刪除的教材編號:");
scanf("%s",num);
p=e=head;
if(strcmp(p->number,num)==0) { head=head->next; print(head);return head;}
else p=p->next;
do{

if(strcmp(p->number,num)==0)
{
if(p->next!=NULL)
e->next=p->next;
if(p->next==NULL) e->next=NULL;
print(head);
return head;
}
p=p->next;
e=e->next;
}while(p!=NULL);
printf("搜索完畢,未找到該記錄");
return head;
}

struct book *change(struct book *head) /*修改記錄*/
{ struct book *p;
char num[20];
if(head==NULL) {printf("未打開任何文件");getchar();return NULL;}
printf("請輸入要修改的教材編號:");
scanf("%s",num);
getchar();
p=head;
do{
if(strcmp(p->number,num)==0)
{
printf("教材編號:%s\n教材名稱:%s\n數量:%d\n價格:%d\n專業:%s\n作者:%s\n出版社:%s\n備註:%s\n",p->number,p->shuming,p->shuliang,p->jiage,p->zhuanye,p->zuozhe,p->chubanshe,p->beizhu);
printf("\n教材編號:");
gets(p->number);
printf("\n教材名稱:");
gets(p->shuming);
printf("\n數量:");
scanf("%d",&p->shuliang);
printf("\n價格:");
scanf("%d",&p->jiage);
getchar();
printf("\n專業:");
gets(p->zhuanye);
printf("\n作者:");
gets(p->zuozhe);
printf("\n出版社:");
gets(p->chubanshe);
printf("\n備注:");
gets(p->beizhu);
printf("修改成功");
return head;
}
p=p->next;
}while(p!=NULL);
printf("未找到要修改的記錄");
return head;
}

int mima()
{ FILE *fp;
char mima1[20],mima2[20];

if((fp=fopen("mima","r"))==NULL)

{ printf("尚未設置密碼請輸入:");
scanf("%s",mima1);
printf("請再次輸入密碼:");
scanf("%s",mima2);
if(strcmp(mima1,mima2)!=0) { printf("兩次密碼不一樣");return 0;}
else {
fp=fopen("mima","w");
fprintf(fp,"%s",mima1);
printf("密碼設置成功");
return 1;
}
}

printf("請輸入初始化密碼:");
scanf("%s",mima1);
fscanf(fp,"%s",mima2);
if(strcmp(mima1,mima2)==0)
{
printf("密碼正確");
printf("請輸入要刪除的文件名:");
scanf("%s",mima1);
if(remove(mima1)==0)
{
printf("刪除成功");
getchar();
return 1;
}
else {
printf("刪除失敗,請檢查是否存在該文件或路徑是否正確");
getchar();
return 0;
}
}
else {
printf("密碼錯誤");
getchar();
return 0;
}

}
void main()
{
struct book *head=NULL;
char i;
getch();

system("cls");
do{
printf(" ☆★☆★☆★ 教材管理系統 ☆★☆★☆★\n");
printf("m--菜單 h--幫助");
printf("\n請輸入命令:");
i=getch();
if(i=='h')
{ printf("\n1,錄入教材信息的時候,每一個項目都必須輸入相應的內容。\n2,修改,增加,刪除,查找記錄前必須先打開一個文件,修改完後必須記得保存教材信息。\n3,必須使用正確的路徑打開文件,建議保存文件時候不用輸入路徑(此時是默認路徑,即保存在程序目錄下。)");
getch();
break;
}
if(i=='m')
break;
system("cls");
}while(i!='m'||i!='h');

system("cls");
do{
printf(" ☆★☆★☆★ 教材管理系統 ☆★☆★☆★\n");

printf("┌————-———┐\n");
printf("│1,錄入教材信息│\n│2,顯示教材信息│\n│3,打開一個記錄│\n│4,編輯一個記錄│\n│5,保存教材信息│\n│6,查找記錄 │\n│s,初始化系統 │\n│e,退出系統 │\n");
printf("└———————-┘\n");
printf("\n請輸入功能編號:");
i=getch();
system("cls");
switch(i)
{
case '1': head=creat();save(head);break;
case '2': print(head);break;
case '3': head=openfile();break;
case '4': system("cls");
printf("┌————-———┐\n");
printf("│1,增加一個記錄│\n");
printf("│2,刪除一個記錄│\n");
printf("│3,修改一個記錄│\n");
printf("└———————-┘\n");
i=getch();
switch(i)
{
case '1':
head=add(head);break;
case '2':
head=delet(head);break;
case '3': head=change(head);break;
default: break;
}
break;
case '5': save(head);break;
case '6': shumingsearch(head);break;
case 's': mima();break;
case 'e': exit(0);
default :break;
}
system("cls");
}while(1);
}

③ VC中如何正確使用ADO

資料庫與資料庫編程:

  • 當前各種主流資料庫有很多,包括Oracle, MS SQL Server, Sybase, Informix, MySQL, DB2,
    Interbase / Firebird, PostgreSQL, SQLite, SAP/DB, TimesTen, MS ACCESS等等。

  • 資料庫編程是對資料庫的創建、讀寫等一列的操作。資料庫編程分為資料庫客戶端編程與資料庫伺服器端編程。資料庫客戶端編程主要使用ODBC API、ADO、ADO.NET、OCI、OTL等方法;資料庫服務端編程主要使用OLE DB等方法。

  • 資料庫編程需要掌握一些訪問資料庫技術方法,還需要注意怎麼設計高效的資料庫、資料庫管理與運行的優化、資料庫語句的優化。

  • ADO編程的一般步驟:

  • 創建一個Connection對象

  • 打開數據源,建立同數據源的連接

  • 執行一個SQL命令

  • 使用結果集

  • 終止連接

  • ADO最重要的三個對象:

  • 連接對象(Connection)

  • 命令對象(Command)

  • 記錄集對象(RecordSet)

  • 在使用這三個對象的時候,需要定義與之相對應的智能指針:_ConnectionPtr、_CommandPtr、_RecordsetPtr

    使用智能指針要:定義指針變數、創建其實例(實例化)、調用方法和屬性。該智能指針在析構對象時,自動調用Release方法,即使用後不需要手動釋放內存,代碼更加簡潔。

    但需要調用Close方法,關閉連接Connection或者記錄集RecordSet。

④ VC++資料庫編程中 ADO_INIT是什麼意思啊

ADO是微軟的資料庫引擎,做成DLL可被程序員調用,調用前需要初始化一下,這個函數可以做這個用。通常COM組件用的時候都要初始化一下,總之你用就對了,不用還不行,呵呵

熱點內容
樂橙雲存儲免費 發布:2025-03-31 10:03:13 瀏覽:372
壓縮襪的作用 發布:2025-03-31 09:54:34 瀏覽:634
安卓紅包哪個好 發布:2025-03-31 09:53:54 瀏覽:562
王者榮耀剪輯視頻腳本 發布:2025-03-31 09:48:06 瀏覽:593
紅米note2加密手機 發布:2025-03-31 09:47:17 瀏覽:275
伺服器ip地址怎麼設置固定 發布:2025-03-31 09:43:24 瀏覽:507
python27scipy 發布:2025-03-31 09:42:14 瀏覽:800
買寶來車選哪個配置 發布:2025-03-31 09:39:45 瀏覽:315
網校系統開源源碼 發布:2025-03-31 09:34:14 瀏覽:126
編程停止移動 發布:2025-03-31 09:34:12 瀏覽:183