Dim rs2 As New ADODB. You
The Set rs2. ActiveConnection=CNN
Rs2. CursorType=adOpenStatic
Sqlstring2="select * FROM reach the point where 'langfang station"
Rs2. Open sqlstring2
Dim the dd (1 To 14) As the Date 'establishing deposit arrive time array
For I=1 To 14
Dd (I)=rs2. Fields (" langfang station ")
Rs2. MoveNext
The arrival of the Next 'langfang station moment in the array
For m=1 To 13
For n=m + 1 To 14
If the dd (m) & gt; Dd (n) Then
T=dd (m)
Dd (m)=dd (n)
Dd (n)=t
End the If
Next
Next 'will arrive in time sequence
Dim rs3 As New ADODB. You
The Set rs3. ActiveConnection=CNN
Rs3. CursorType=adOpenStatic
Rs3. Open the "select trains from moment where langfang station=dd (1)" 'there was a problem, the dd no function definition
Checi=rs3 (" service "). The Value
This is the code I wrote but execution always says dd function is not defined clearly defined I dd is an array and assignment?? I just want to query the corresponding moment trains for help you a great god??????
CodePudding user response:
Rs3. Open the "select trains from moment where langfang station=dd (1)"Modify the
Rs3. Open the "select * from moment where langfang station=" & amp; Dd (1) & amp;" "
Problem: 1, the dd (1) is a variable, not directly on=behind, and the need to take the form of variables; 2, select trains from the can not, because the only connection is on the field, but field, there is no way to connect "langfang station", therefore, is modified to * is reasonable; 3, don't know what your database is a database, due to the dd (I) an array data type is date, depending on the database, the statement is not the same, this is the SQL 2000 database connection statement; 4, actually some statements may be omitted completely, such as the Set rs3. The ActiveConnection=CNN and the rs3. CursorType=adOpenStatic, can use the rs3. Open the "select * from reach the point where=" langfang station & amp; Dd (1) & amp;" ", CNN, 2, 2 a statement instead
CodePudding user response:
Thank god I still have a little problem is that I am using access2000 database according to the above I changed but now there is a "grammar errors (operator) lost" is how to return a responsibility? Where the problem?" & Dd (1) & amp;" ", CNN, 2, 2, and the 2, 2 I'm not very understanding, has been here 2 on behalf of what?CodePudding user response: