How to retrive/update database by writing code in expert viewIn my case database is Accessmy dsn name="try"database name="employee.mdb"

Showing Answers 1 - 1 of 1 Answers

suresh

  • May 15th, 2006
 

Dim samp

 Set samp=createobject("ADODB.Connection")

samp.ConnectionString="DSN=try"

samp.open strQuery="Select * from employee"

Set sampresults=samp.execute(strQuery)

a=sampresults.fields.count

Do until sampresults.eof

For i = 0 to a-1

b=sampresults.fields.item(i).value

reporter.ReportEvent 2,"column " & i , b

Next

sampresults.movenext

Loop

sampresults.close

samp.close

Set sampresults=nothing

Set samp=nothing

' for updating the table

strQuery="update employee set column name = new value where column name = some _value"

Set sampresults=samp.execute(strQuery)

  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