How to write script using Database

Hello,

I have imported log file into MS access with columns server,date,time,url.I need to write VB script in VB editor for accessing rows in between given date and time.

It's urgent.please can any body help with this.


Thanks

Questions by sappi_01

Showing Answers 1 - 3 of 3 Answers

MS Access has built-in Visual Basic Module Editor,
Click on Modules Tab
Click New
Create Public Function
Put in your code
Save, Close, Re-Open,
Now you can use your VB Script anywhere in MS Access by calling the function name.

Code
  1. Public Function Fetch_Log_Rows(xDate as Date, xTime as Date)

  2.  

  3. Dim xRec as DAO.Recordset

  4.  

  5. Set xRec = CurrentDb.OpenRecordset ("SELECT * FROM [Log_Table] Where Date = #"+xDate+" and Time = #" + xTime + "#")

  6.  

  7. xRec.MoveFirst

  8. While xRec.EOF = False

  9.    'Do Whatever you want here

  10.    xRec.MoveNext

  11. Wend

  12.  

  13. End Function

  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