Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - CalendarControl.DataProvider.Create
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CalendarControl.DataProvider.Create

 Post Reply Post Reply
Author
Message
elmsoftware View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2006
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote elmsoftware Quote  Post ReplyReply Direct Link To This Post Topic: CalendarControl.DataProvider.Create
    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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 23 November 2006 at 9:09am
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
Back to Top
elmsoftware View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2006
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote elmsoftware Quote  Post ReplyReply Direct Link To This Post Posted: 23 November 2006 at 9:48am
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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 23 November 2006 at 10:02am
Originally posted by elmsoftware elmsoftware wrote:

When I run the 'Create' method when pointing to a blank database, no tables for me get created.
...


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
Back to Top
elmsoftware View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2006
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote elmsoftware Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2006 at 12:23pm
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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2006 at 4:17pm
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
Back to Top
elmsoftware View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2006
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote elmsoftware Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2006 at 5:08pm
Originally posted by sserge sserge wrote:


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).

 
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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2006 at 5:56pm
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
Back to Top
elmsoftware View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2006
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote elmsoftware Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2006 at 11:18pm
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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2006 at 4:35pm
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
Back to Top
elmsoftware View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2006
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote elmsoftware Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2006 at 6:42pm
Much appreciated.
 
All the best,
 
John
Back to Top
elmsoftware View Drop Down
Groupie
Groupie
Avatar

Joined: 21 November 2006
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote elmsoftware Quote  Post ReplyReply Direct Link To This Post Posted: 22 December 2006 at 12:40pm
Thank you for the .Create method update in 10.4.
It works perfectly and is much appreciated.
 
All the best,
 
John
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.