CalendarControl.DataProvider.Create |
Post Reply |
Author | |
elmsoftware
Groupie Joined: 21 November 2006 Status: Offline Points: 23 |
Post Options
Thanks(0)
Posted: 22 November 2006 at 10:38am |
Hello,
We use VB6 and Access in our applications.
In the example code provided in VB6>>CalenderSample.vbp there are the lines in the OpenProvider routine...
CalendarControl.SetDataProvider strConnectionString
If Not CalendarControl.DataProvider.Open Then CalendarControl.DataProvider.Create End If ...Mentioned in a previous post...if the four CalendarPro dependent tables are not in the Access database they will be created.
What I have found is that only the 'Schedules' table is being created when I point the example code to a blank mdb. (In the given example it points to the 'events.mdb'...I created a blank 'test.mdb' with no password protection) - Schedules (Created)
- Event (Not Created)
- Options (Not Created)
- RecurrencePattern (Not Created) Also, even if I 'Set Next Statement' to run the CalendarControl.DataProvider.Create method I still get just the 'Schedules' table created...see image below.
Thoughts?
All the best,
John
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi,
Currently when you call Open on not existing database it fails, for an existing database it processes fine, even if there is not all 4 tables created. Table Schedules was added in last versions of the control, and it is added automatically if doesn't exist in the database. That's why only 1 table is created if you call Open. For future we'll fix this behavior by adding all necessary tables existence validation code into Open method. Method Create will create all the necessary tables corectly. -- WBR, Serge |
|
elmsoftware
Groupie Joined: 21 November 2006 Status: Offline Points: 23 |
Post Options
Thanks(0)
|
Hello,
Environment: VB6 and Access database
I purchased the Suite just the other day.
--------------------------------------------------
When I run the 'Create' method when pointing to a blank database, no tables for me get created.
Create statement
In the example below...
1) CalendarControl.SetDataProvider statement is run
2) 'Set Next Statement' to run the 'Create' method and no tables get created in my blank database.
Note: The .Open method is skipped in this example
Normal Code Flow
1) SetDataProvider would run.
2) The Open statement would run and the 'Schedules' table gets created.
3) The Open statement returns True so the Create method is not run.
What are your thoughts on the .Create statement not working as expected?
The controls in the Suite are top notch and we are excited about adding them to our applications.
John
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Do not create a blank database by yourself, just set a name of the database to be created in the connection string, and it will be created automatically. -- WBR, Serge |
|
elmsoftware
Groupie Joined: 21 November 2006 Status: Offline Points: 23 |
Post Options
Thanks(0)
|
Thank you for your prompt responses.
We have a wedding software program that exists with 40+ tables in an Access database and we want to add this control to our application as well as the four tables.
How do I create the four CalendarPro tables in a database that already exists?
Do you recommend that I look at the design of the four tables and then create the tables manually in code using ADOX?
What are your thoughts?
John
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
The answer would be exactly like in a previous post
Do not create tables by yourself, just set a name of your database in the connection string, call Create and they will be created automatically (it uses ADOX internally). ps: when testing, do not forget to backup your DB -- WBR, Serge |
|
elmsoftware
Groupie Joined: 21 November 2006 Status: Offline Points: 23 |
Post Options
Thanks(0)
|
Hi Serge,
When I call .Create the four tables do not get created automatically.
Only the 'Schedules' table gets created.
That is my experience.
I need the .Create method to add the four tables to my pre-existing Access database...not in a blank non-existing database.
You helped in previous posts about how the .Create method adds the four tables to a non-existing database but I would like the tables to be created in my pre-existing database.
What are your thoughts?
Thank you for your time.
John |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
John,
Try the following: open regular VB Calendar Sample, choose File/Open/Use DB data provider, enter the name of your DB file (with your tables exsting, but without Calendar's tables), and press Ok. As you can see, now the database contains both your tables, and all needed for Calendar. -- WBR, Serge |
|
elmsoftware
Groupie Joined: 21 November 2006 Status: Offline Points: 23 |
Post Options
Thanks(0)
|
Hi Serge,
What I did...
1) Open and ran the VB Calendar Sample provided.
2) Choose File/Open/Use DB data provider.
3) Entered the name of a mdb file located in the same directory as the Calendar Sample code.
4) Click OK.
5) The only table added is the 'Schedules' table.
I am running VB6 (SP6) using ADO 2.8 on Windows XP Pro computer.
Thank you for your patience.
Sorry to rehash this, but I cannot get the .Create to work with a pre-existing Microsoft Access database.
John |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
For 10.4 method .Create will be fixed.
For now you can simply export required Calendar tables from the DB created from scratch to your DB using Access Export tool. -- WBR, Serge |
|
elmsoftware
Groupie Joined: 21 November 2006 Status: Offline Points: 23 |
Post Options
Thanks(0)
|
Much appreciated.
All the best,
John
|
|
elmsoftware
Groupie Joined: 21 November 2006 Status: Offline Points: 23 |
Post Options
Thanks(0)
|
Thank you for the .Create method update in 10.4.
It works perfectly and is much appreciated.
All the best,
John
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |