Announcement

Collapse
No announcement yet.

example: using vbscript to get data out of actinic

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    example: using vbscript to get data out of actinic

    Code:
    'my shop database is located at:
    mydb = "C:\Program Files\Actinic V8\Sites\Site1\ActinicCatalog.mdb"
    
    				Set OBJdbConnection2 = CreateObject("ADODB.Connection")
    				OBJdbConnection2.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & mydb
    				SQLQuery2 = "SELECT [ProductReference],[QuantityOrdered] FROM [OrderDetail] WHERE [ProductReference] LIKE '" & thisprodref & "'"
    				Set Result2 = OBJdbConnection2.Execute(SQLQuery2)
    
    				if Not Result2.EOF then
    				  Do While Not Result2.EOF
    					thiscount = thiscount + Result2("QuantityOrdered")
    					
    					Result2.MoveNext
    				  Loop
    				end if
    				OBJdbConnection2.Close
    for the vb inclined, here is how to access the datavase using vbscript, and perform loops through datasets. placeholders hare here for the sql and how to get at the variables.

    prerequisite knowledge:
    - vbscript
    - sql

    this example only counts how many times a specific product ref has been ordered. 'thisprodref' in the sql is the product reference.

    have fun.

    #2
    Gabs you at it again

    Comment


      #3
      sometimes, i come across ways of doing things, that other people might find useful.#

      this one is only useful if you are wanting to use vb to access the catalog... you'll need some prior knowledge however, such as the product ref number, for this example.

      the sql can easily be customised.

      Comment


        #4
        I will be honest Gabs, alot of the stuff i could probably use, but time and knowledge are my biggest brick walls now days

        D

        Comment

        Working...
        X