1、请问如何实现榆数据库的动态炼结?
2、请问如何查询一个表?
3、请问作数据库的开发是不是药用activex 的控件?
2、请问如何查询一个表?
3、请问作数据库的开发是不是药用activex 的控件?
解决方案 »
- 如何防止用户恶意修改程序的名称
- 这个项目该怎么建?
- 小弟工作(软件开发)近一年了,有许多困惑。。。希望得到指点
- >>>>>>>>>>>>>>>>>>>反对日本为常任理事国签名<<<<<<<<<<<<<<<<<<[请求固顶]
- 用vc来提取电脑眼中的视频数据到底放在什么地方了?用什么函数?
- 如何更换界面,不知能否实现?在线等
- 有关映射模式的一个函数的用法
- 各位大哥,请告诉我一些支持ASP和Sql Server2000的网站空间,收费的
- 有提供远程模拟linux操作系统的网站吗?
- 如何使用安裝程序将原程序打包后在目標机上安裝
- 请问_bstr_t是什么东西?和LPTSTR兼容吗?
- 使用video for windows 的几个问题
2.select * from tblname
3.不一定要用.
主要有以下類:CDatabase、CRecord
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Data Source").value = App.Path & "\data.mdb"
.Properties("Persist Security Info").value = True
.Properties("Jet OLEDB:Database Password").value = "pass"
.CommandTimeout = 30
End With
'定义对象
Set DBRecordset = New ADODB.Recordset
With DBRecordset
'初始化一些属性
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.CursorType = adOpenStatic
Set .ActiveConnection = cn
.Source = "select * from t_records where id=" & lRecordID
'打开数据集
.Open
If .EOF And .BOF Then
.AddNew
End If
.Fields!Title = LeftEx(Trim(txttitle.Text), 200)
.Fields!RecordType = lRecordType
.Fields!RType = Val(fraType.Tag)
'更新数据
.Update
'关闭数据集
.Close
End With
不过我想VC也差不多吧.
_CommandPtr pCmd = NULL;
_RecordsetPtr pRs = NULL;
HRESULT hResult = E_FAIL; _bstr_t bstrConn = _bstr_t(L"DSN=AccessDb;");
_bstr_t bstrSQL = _bstr_t(L"SELECT t_Folder.* FROM t_Folder"); // _ConnectionPtr
hResult = pConn.CreateInstance(__uuidof(Connection));
if (FAILED(hResult)) {
AfxMessageBox("pConn.CreateInstance");
return;
}
pConn->CursorLocation = adUseClient;
pConn->ConnectionString = bstrConn;
pConn->Open(_bstr_t(L""), _bstr_t(L""), _bstr_t(L""), -1); // _CommandPtr
hResult = pCmd.CreateInstance(__uuidof(Command));
if (FAILED(hResult)) {
AfxMessageBox("pCmd.CreateInstance");
return;
}
pCmd->ActiveConnection = pConn;
pCmd->CommandText = bstrSQL;
pCmd->CommandType = adCmdText; // _RecordsetPtr
hResult = pRs.CreateInstance(__uuidof(Recordset));
if (FAILED(hResult)) {
AfxMessageBox("pRs.CreateInstance");
return;
}
pRs->Open((_Command*)pCmd, vtMissing, adOpenForwardOnly, adLockOptimistic, adCmdText);
if (pRs->Supports(adAddNew) && pRs->Supports(adUpdate)) {
pRs->AddNew();
pRs->PutCollect(L"fName", L"fName");
pRs->PutCollect(L"fParent", _variant_t(11L));
pRs->Update();
}
你最上边的那句话市不是引用的delphi的tlb文件?
import 在vc中是什么意思?请执教