this code for databases is exactly what i was looking for. I understand all of it except the stuff below.
Code:
rsLigue.CursorType = adOpenStatic
rsLigue.CursorLocation = adUseClient
rsLigue.LockType = adLockPessimistic
rsLigue.Source = "Select * From [Ligue]"
rsLigue.ActiveConnection = DB
rsLigue.Open
Also, this is the sql i have coded during design time. Do i need to modify at all. Im just wondering because you use square brackets in your sql statement.
Code:
SELECT exam_order,objectives,subject FROM Phase1b where exam_order > 0 AND objectives <> " " order by exam_order asc
it is the first time that I get a reply that I do something right. I used only the brackets to show the table better, but you don't need the brackets.
Your SQL-statement looks fine to me.
The code for the recordset rsLigue (french word for league) is to open in the already opened connection the recordset. You can open the recordsets that are in your MDB. Why I used the parameters there is a little homework for you. Check the MSDN , there you find why I did this.
Source Property (Recordset) ADO
Indicates the source for the data in a Recordset object (Command object, SQL statement, table name, or stored procedure).
Applies To
Recordset
Settings and Return Values
Sets a String value or Command object reference; returns only a String value.
Remarks
Use the Source property to specify a data source for a Recordset object using one of the following: a Command object variable, an SQL statement, a stored procedure, or a table name . The Source property is read/write for closed Recordset objects and read-only for open Recordset objects.
If you set the Source property to a Command object, the ActiveConnection property of the Recordset object will inherit the value of the ActiveConnection property for the specified Command object. However, reading the Source property does not return a Command object; instead, it returns the CommandText property of the Command object to which you set the Source property.
If the Source property is an SQL statement, a stored procedure, or a table name, you can optimize performance by passing the appropriate Options argument with the Open method call.
You realise that you could put a link to this thread in your sign bit (see UserCP>Profile) and when you answer any post its there for people to jump to.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...