How do you use MS Access as an object and fetch the values from MS Access database like an excel sheet?

Showing Answers 1 - 1 of 1 Answers

adisgee

  • Aug 2nd, 2007
 

this should help:

' -----------------------------------------------------------------
Set dbConn = CreateObject("ADODB.Coonection")
dbConn.Open("DSN=MyDatabase")

sqlQuery = "Select * From Main_Table"

Set rsRecSet = dbConn.Execute(sqlQuery)

rsRecSet.MoveFirst

Do Until rsRecSet.EOF
   varColumn1 = rsRecSet("Coulmn1").Value
   ...
   ...
   ...
Loop

Set dbConn = Nothing
' -----------------------------------------------------------------

Set the DSN using the ODBC administrator from Control panel -> Admistrative Tools.

Thanks,
Aditya.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions