Access Database Connection Sample
Average Rating: 10
Yours: -1
File Size: .02MB
Downloads Today: 0 Downloads Total: 1486

Access Database Connection Sample

Updated Jul 02, 2004 by _Martin_


danioc
Comment #1 Friday, July 02, 2004 7:58 AM
Nice
c242
Comment #2 Friday, July 02, 2004 12:12 PM
Uh. oh... Goes checking...
c242
Comment #3 Friday, July 02, 2004 12:14 PM
That is easy !
joetheblow
Comment #4 Friday, July 02, 2004 2:31 PM
ikku
Comment #5 Monday, July 05, 2004 3:11 AM
Cool object i got it working with my own database, now for the question.

it doesn't seem to update? how do i do that?

mind you, i'm a noob with scripting

Felix
_Martin_
Comment #6 Monday, July 05, 2004 3:58 AM
Made an update for you Felix so that it updates every minute.
ikku
Comment #7 Monday, July 05, 2004 5:52 AM
Hmm doesn't look to be working, and the script looks still the same?

Felix
_Martin_
Comment #8 Tuesday, July 06, 2004 12:18 AM
Maybe your download didn't work then. This is the script.


Dim accessdb
Dim ConnectionString
Dim Connection
Dim strQuery
Dim RS

'Called when the script is executed
Sub Object_OnScriptEnter
Object.SetTimer 1,60000
Object_OnTimer1
End Sub

Sub Object_OnTimer1
Object.Text = ""

'### Set the location of the database
accessdb=Object.Directory & ("db1.mdb")

'### Build a dsn-less connection string
ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)}"
ConnectionString=ConnectionString & "DBQ=" & accessdb

'### Create the ADO Connection object
Set Connection = CreateObject("ADODB.Connection")
Connection.Open ConnectionString

'### Create a SQL query string
strQuery = "SELECT * FROM Table1"

'### Execute the SQL query
Set RS = Connection.Execute(strQuery)

'### Maninpulate the recordset object you have just created
While Not RS.EOF
Object.Text = Object.Text & RS("Item") & ": " & RS("Value") & vbNewLine
RS.MoveNext
Wend
End Sub

'Called when the script is terminated
Sub Object_OnScriptExit
'### Clean-up

RS.Close
Connection.Close
Set RS = Nothing
Set Connection = Nothing
End Sub
ikku
Comment #9 Monday, July 12, 2004 2:00 AM
cool, it works, thanks a lot

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading files.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!

Featured DesktopX Objects

Popular DesktopX Objects

Top DesktopX Objects Skinners

Yesterday  |   Last 30 Days  |   All Time
1. _Martin_ 456
2. Frogboy 295
3. mormegil 242
4. DaWebMassa 215
5. theAVMAN 209
6. pjpowell 178
7. c242 172
8. ChaosMachine 152
9. Carlitus 147
10. SS GOKU 147
11. JamesT 146
12. BoXXi 126
13. deggy 121
14. Island Dog 110
15. sViz 100



walnut1