我怀疑,我想对一个表格执行。 随着结果的产生,我想做一些事情。 在我的领导下,《假冒法》是:
var q = "select * from table where some condition";
var results = db.getResults(q);
foreach (row r in results )
do something with result
我怎么会这样说与真?一样?
我怀疑,我想对一个表格执行。 随着结果的产生,我想做一些事情。 在我的领导下,《假冒法》是:
var q = "select * from table where some condition";
var results = db.getResults(q);
foreach (row r in results )
do something with result
我怎么会这样说与真?一样?
DAO是本土的,迄今为止是最佳的。 反歧视局有其地位,但不大可能这样做。
Dim rs As DAO.Recordset
Dim db As Database
Dim strSQL as String
Set db=CurrentDB
strSQL = "select * from table where some condition"
Set rs = db.OpenRecordset(strSQL)
Do While Not rs.EOF
rs.Edit
rs!SomeField = "Abc"
rs!OtherField = 2
rs!ADate = Date()
rs.Update
rs.MoveNext
Loop
Ah. 由于我错过了你最初的职位,这里也是国际睦邻会的一个实例。 第一个例子没有。 在此情况下,我撤销了非行的记录,然后将数据输入收集,根据职能将数据退回客户代码:
EDIT:不肯定我过去所篡改的手法,但格式是一小rew。 Sorry!
Public Function StatesCollection() As Collection
Dim cn As ADODB.Connection
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
Dim colReturn As New Collection
Set colReturn = New Collection
Dim SQL As String
SQL = _
"SELECT tblState.State, tblState.StateName " & _
"FROM tblState"
Set cn = New ADODB.Connection
Set cmd = New ADODB.Command
With cn
.Provider = DataConnection.MyADOProvider
.ConnectionString = DataConnection.MyADOConnectionString
.Open
End With
With cmd
.CommandText = SQL
.ActiveConnection = cn
End With
Set rs = cmd.Execute
With rs
If Not .EOF Then
Do Until .EOF
colReturn.Add Nz(!State, "")
.MoveNext
Loop
End If
.Close
End With
cn.Close
Set rs = Nothing
Set cn = Nothing
Set StatesCollection = colReturn
任 务
我知道,在2010年行政协调会中发生了一些变化。 然而,正如我所知,老的阿拉伯工业发展基金会是最佳途径。 例:
Dim cn As ADODB.Connection
Dim cmd As ADODB.Command
Dim prm As ADODB.Parameter
Dim rs As ADODB.Recordset
Dim colReturn As New Collection
Dim SQL As String
SQL = _
"SELECT c.ClientID, c.LastName, c.FirstName, c.MI, c.DOB, c.SSN, " & _
"c.RaceID, c.EthnicityID, c.GenderID, c.Deleted, c.RecordDate " & _
"FROM tblClient AS c " & _
"WHERE c.ClientID = @ClientID"
Set cn = New ADODB.Connection
Set cmd = New ADODB.Command
With cn
.Provider = DataConnection.MyADOProvider
.ConnectionString = DataConnection.MyADOConnectionString
.Open
End With
With cmd
.CommandText = SQL
.ActiveConnection = cn
Set prm = .CreateParameter("@ClientID", adInteger, adParamInput, , mlngClientID)
.Parameters.Append prm
End With
Set rs = cmd.Execute
With rs
If Not .EOF Then
Do Until .EOF
mstrLastName = Nz(!LastName, "")
mstrFirstName = Nz(!FirstName, "")
mstrMI = Nz(!MI, "")
mdDOB = !DOB
mstrSSN = Nz(!SSN, "")
mlngRaceID = Nz(!RaceID, -1)
mlngEthnicityID = Nz(!EthnicityID, -1)
mlngGenderID = Nz(!GenderID, -1)
mbooDeleted = Deleted
mdRecordDate = Nz(!RecordDate, "")
.MoveNext
Loop
End If
.Close
End With
cn.Close
Set rs = Nothing
Set cn = Nothing
In C#, I know that I can overload the constructor for a class by specifying it in the body of the class: public class MyClass() { public MyClass(String s) { ... } } This overrides the default ...
I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...
I recently switched to Outlook 2007 and noticed that my VBA-macros won t work. I use the following code to open a new appointment-item (and fill it automatically). It worked perfect in Outlook 2003, ...
The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...
I m using Application run to call several macros in order like this. Sub Run_All_Macros() Application.Run ("Macro_1") Application.Run ("Macro_1") End Sub When I start Run_All_Macros, all the ...
I m using Microsoft Office 2003 and creating a bunch of template documents to standardize some tasks. I asked this on Superuser.com and got no response so I m thinking it s too program-y and hoping I ...
I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...
I need to ensure a Macro which works on Visio 2003 doesn t cause problems on lower versions of Visio: specifically because I m writing to a property which doesn t exist on lower versions of Visio. ...