如何取得Access当前连接数?(200)

  • 主题发起人 主题发起人 hgood
  • 开始时间 开始时间
H

hgood

Unregistered / Unconfirmed
GUEST, unregistred user!
如题,在网上找下以下代码,是VB的,请帮忙高手转换为delphi的,谢谢。Sub ShowUserRosterMultipleUsers()Dim cn As New ADODB.ConnectionDim rs As New ADODB.RecordsetDim i, j As LongSet cn = CurrentProject.Connection' The user roster is exposed as a provider-specific schema rowset' in the Jet 4.0 OLE DB provider. You have to use a GUID to' reference the schema, as provider-specific schemas are not' listed in ADO's type library for schema rowsetsSet rs = cn.OpenSchema(adSchemaProviderSpecific, _, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")'Output the list of all users in the current database.Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, _While Not rs.EOFDebug.Print rs.Fields(0), rs.Fields(1), _rs.Fields (2), rs.Fields(3)rs.MoveNextWendEnd Sub
 
我也是初次涉足到这个方面的,原来还有这么多好的方法得到数据库里的参数。学习了。敬请笑纳:procedure TFrmMain.GetConns(Projectconn: TADOConnection);var DataSet: TADODataSet;begin DataSet := TADODataSet.Create(nil); Projectconn.OpenSchema(siProviderSpecific, EmptyParam, '{947bb102-5d43-11d1-bdbf-00c04fb92675}', DataSet); Memo1.Clear; while not DataSet.Recordset.EOF do begin Memo1.Lines.Add(DataSet.Fields.Fields[0].AsString + ' ' + DataSet.Fields.Fields[1].AsString + ' ' + DataSet.Fields.Fields[2].AsString + ' ' + DataSet.Fields.Fields[3].AsString + ' '); DataSet.Next; end;end;
 
接受答案了.
 

Similar threads

I
回复
0
查看
602
import
I
I
回复
0
查看
1K
import
I
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部