Can you please give datasource example ?

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
kamleshvgujarathi
Posts: 39
Joined: Fri Jan 09 2004
Location: Bombay ( INDIA)
Contact:

Can you please give datasource example ?

Post by kamleshvgujarathi »


In developer guide there is not any single example for use of the datasource property.

So can you give me short example of datasource ?


I am very Happy for QUICK RESPONCE to previous Problems

:roll:
KamleshvGujarathi
kamlesh@itshastra.com
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Here is a small VB sample on attaching a pdf file to a database.

=========================================

Dim pdf As New ACPDFCREACTIVEX.PDFCreactiveX

With pdf
.SetLicenseKey Licensee, ActivationCode

'Create a text object
.CreateObject acObjectTypeText, "Mytext"

'Position the text
.ObjectAttribute("Mytext", "Left") = 600
.ObjectAttribute("Mytext", "Top") = 600
.ObjectAttribute("Mytext", "Right") = 700
.ObjectAttribute("Mytext", "Bottom") = 700
.ObjectAttribute("Mytext", "Text") = " GETTING INFORMATION FROM A DATABASE"

'Set the data source to an Access file
.DataSource = "University.mdb"

'Set the main table
.DataTableOrView = "Majors"

'Create a field object
.CreateObject acObjectTypeField, "Field1"

'Position Field1
.ObjectAttribute("Field1", "Left") = 1000
.ObjectAttribute("Field1", "Top") = 1000
.ObjectAttribute("Field1", "Right") = 2000
.ObjectAttribute("Field1", "Bottom") = 1500


'Set the object value to be:
'the field CreditsRequired (( multiplied by (*) the field FeesInUSD))
.ObjectAttribute("Field1", "Text") = "=Majors.FeesInUSD * Majors.CreditsRequired"

'Save the pdf file
.Save "Test2.pdf", 0

End With

Set pdf = Nothing

===================================


Hope this helps.
Post Reply