数据库已经用ACCESS建立好了,已经有一个表,但是现在要求把程序运行中接受到的新数据存储到数据库中,并且是存储到一个新的表中,表的结构和已经有的那个表结构一致。数据库的连接是用的DAO,怎么样才能打开数据库,新建表把数据动态存储进去?急!急!急!
解决方案 »
- 【---------回调函数属于哪个进程?----------】
- 求教,如何做一个像word里的菜单和工具条可以任意添加菜单条和拖动
- 皮肤,,皮肤,,百分相送。
- 我发个菜鸟问题, 关于按钮与BMP的问题,把你的邮箱给我
- 一个QQ有几个线程在工作?
- WTL的"CCommandBarCtrl"能不能在 "右键菜单" 和 "系统托盘菜单"中使用????? 如何使用????
- DirectX里显示内存中的位图的问题,请解答!!!!!!!!!!!!!!!!!
- 有关ofstream
- 用SDK开发程序与WEB服务器通讯,该怎么做呢???请大家帮忙!!!急!!!
- 如何在程序运行中激活某一对话框中的按钮
- 控制台下获取输入值
- VC++定义全局数组
然后再用Insert Into NewTable Values(...)插入数据
http://www.vckbase.com/
不想再换ADO了
所以麻烦帮帮忙啊~~~~~
CDaoDatabase
CDaoTableDef
等类的用法。
CDaoDatabase::Execute
void Execute( LPCTSTR lpszSQL, int nOptions = 0 );
throw( CDaoException, CMemoryException );ParameterslpszSQLPointer to a null-terminated string containing a valid SQL command to execute.nOptionsAn integer that specifies options relating to the integrity of the query. You can use the bitwise-OR operator (|) to combine any of the following constants (provided the combination makes sense — for example, you would not combine dbInconsistent with dbConsistent): dbDenyWrite Deny write permission to other users.
dbInconsistent (Default) Inconsistent updates.
dbConsistent Consistent updates.
dbSQLPassThrough SQL pass-through. Causes the SQL statement to be passed to an ODBC data source for processing.
dbFailOnError Roll back updates if an error occurs.
dbSeeChanges Generate a run-time error if another user is changing data you are editing.
Note If both dbInconsistent and dbConsistent are included or if neither is included, the result is the default. For an explanation of these constants, see the topic "Execute Method" in DAO Help.ResCall this member function to run an action query or execute an SQL statement on the database. Execute works only for action queries or SQL pass-through queries that do not return results. It does not work for select queries, which return records.For a definition and information about action queries, see the topics "Action Query" and "Execute Method" in DAO Help.Tip Given a syntactically correct SQL statement and proper permissions, the Execute member function will not fail even if not a single row can be modified or deleted. Therefore, always use the dbFailOnError option when using the Execute member function to run an update or delete query. This option causes MFC to throw an exception of type CDaoException and rolls back all successful changes if any of the records affected are locked and cannot be updated or deleted. Note that you can always call GetRecordsAffected to see how many records were affected.Call the GetRecordsAffected member function of the database object to determine the number of records affected by the most recent Execute call. For example, GetRecordsAffected returns information about the number of records deleted, updated, or inserted when executing an action query. The count returned will not reflect changes in related tables when cascade updates or deletes are in effect.Execute does not return a recordset. Using Execute on a query that selects records causes MFC to throw an exception of type CDaoException. (There is no ExecuteSQL member function analogous to CDatabase::ExecuteSQL.)For more information about using the Execute member function, see the articleDAO Querydef: Using Querydefs in Visual C++ Programmer's Guide.