如何创建ACCESS2000数据库.mdb文件

comet 2001-08-13 02:48:26
用ADO能否实现?
...全文
193 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
comet 2001-08-14
  • 打赏
  • 举报
回复
to:jiangsheng(蒋晟) 
能举个SQLConfigDataSource的详细例子吗?
蒋晟 2001-08-14
  • 打赏
  • 举报
回复
可以。也可以用SQLConfigDataSource创建。
蒋晟 2001-08-14
  • 打赏
  • 举报
回复
Use of SQLConfigDataSource ODBC installer DLL API function:

BOOL fCreated;
fCreated = SQLConfigDataSource(NULL,
ODBC_ADD_DSN,
"Microsoft Access Driver (*.mdb)",
"CREATE_DB=.\\ATest.mdb General\0" );
This will create ATest.mdb in the application's working directory using general sorting.

BOOL SQLConfigDataSource(hwndParent, fRequest, lpszDriver,
lpszAttributes)
Where:
hwndParent is either NULL if no dialogs are to be displayed or a valid hwnd to act as parent to any driver generated dialogs.

fRequest is ODBC_ADD_DSN to specify creation of the .mdb file.

lpszDriver is Microsoft Access Driver (*.mdb).

lpszAttributes is "CREATE_DB=<path><filename>.mdb <sort order>\0" where the <path><filename> combination identifies where the file should be created and <sort order> is language sorting order (for example, General). <path> must be specified even if the .mdb is to be created in the current working directory. Use standard relative path syntax.
NOTE: Unlike most other ODBC API functions, SQLConfigDataSource returns a boolean value. This return value is TRUE if the .mdb was created, FALSE if creation failed.
comet 2001-08-13
  • 打赏
  • 举报
回复
up
comet 2001-08-13
  • 打赏
  • 举报
回复
to Crob(我干嘛这么帅):

ACCESS2000能行吗?
Crob 2001-08-13
  • 打赏
  • 举报
回复
TableArray m_arTable;
TableStruct *pTable;
FieldStruct *pField;

try{
m_DB.Create("e:\\aaa.mdb");
}
catch(CDaoException *e){
DisplayDaoException(e);
e->Delete();
return;
}
if(m_DB.IsOpen())
{
pTable=new TableStruct;
pTable->Name="表名";
pTable->ID="xxxx";

pField=new FieldStruct;
pField->Name="字段一";
pField->bText=TRUE;
pField->DataType=dbText; //text型
pField->Length=6;
pField->bKey=TRUE;
pTable->FieldArray.Add(pField);//添加到pTable
//................添加其它字段

m_arTable.Add(pTable);
}
Crob 2001-08-13
  • 打赏
  • 举报
回复
用CDaoDatabase,很简单的

CDaoDatabase m_DB;
comet 2001-08-13
  • 打赏
  • 举报
回复
up
comet 2001-08-13
  • 打赏
  • 举报
回复
fz_zhou(vcfan)
you are right!
我不是大明 2001-08-13
  • 打赏
  • 举报
回复
打开工access不就可以了吗!
人是指在程序里面怎么create对吗?
comet 2001-08-13
  • 打赏
  • 举报
回复
up
comet 2001-08-13
  • 打赏
  • 举报
回复
up
sinx 2001-08-13
  • 打赏
  • 举报
回复
装上 DAO 的最新驱动试试 ..... 到微软的网站看看.....
comet 2001-08-13
  • 打赏
  • 举报
回复
ACCESS97 可以用DAO创建。
难道ACCESS2000就没办法?
xiaoc 2001-08-13
  • 打赏
  • 举报
回复
安一个office2000用里面的access了
maxsuy 2001-08-13
  • 打赏
  • 举报
回复
创建?
我倒

4,011

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 数据库
社区管理员
  • 数据库
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧