![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Loop through Northwind records Hi All. I'm trying to do something verysimple with vbscript: open a Northwind table and loop through the recordset, echoing a field as I do so. Here is what I'm attempting. The problem is that I can't find the syntax documented for how to get to the fields of a recordset. The 'FieldByName' part, I made up, to illustrate what I'm trying to do. Const adOpenStatic = 3 Const adLockReadOnly = 1 Const adUseClient = 3 Set objConnection = CreateObject("ADODB.Connection") Set objRecordset = CreateObject("ADODB.Recordset") objConnection.Open "DSN=Northwind;" objRecordset.CursorLocation = adUseClient objRecordset.Open "SELECT * FROM Employees" , objConnection, adOpenStatic, adLockReadOnly do while not objRecordset.eof 'the problem is here wscript.echo objRecordset.FieldByName("Last Name") objRecordset.MoveNext loop objRecordset.Close objConnection.Close Could anyone direct me to either an example or to where I can find documentation? Thanks, Richard |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Loop through Northwind records On Wed, 30 Jul 2008 13:09:42 -0500, "McKirahan" <News@xxxxxx> wrote: Quote: >Basically, objRecordset.FieldByName("Last Name") >should be objRecordset("Last Name").Value That's exactly what I was looking for. Richard |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Mic only records left audio | Sound & Audio | |||
| No MX or A records for .... | Vista mail | |||
| First 400 Records in SQL Statement | VB Script | |||
| dns scavenging records process | PowerShell | |||
| How to add new records to EventLog? | PowerShell | |||