Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Help with Connection to DB PLEASE!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Help with Connection to DB PLEASE!

 Post Reply Post Reply
Author
Message
arrozcon View Drop Down
Newbie
Newbie


Joined: 10 November 2009
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote arrozcon Quote  Post ReplyReply Direct Link To This Post Topic: Help with Connection to DB PLEASE!
    Posted: 10 November 2009 at 10:57pm
Hello,
 
I download the demo to test the Calendar since I want to put that on my App. I have been working on my App for years so changing the way my database is setup is not an option because is alot of work!.
 
I want to show my records on the Calendar using my own TableName (i.e. tblGOActivity) and my own database (ie. Databasenm = go.mdb). This the code I;m working on and I cannt do it because I really dont know! I attach the database connection also for reference.
 
Code I'm working on: 
 
 Dim cur_set As Recordset
 Dim sql_str As String
 
 sql_str = "SELECT * FROM tblGOActivity" 'This is the database I want my Events to be saved"
 If Not goDatabase.CreateSnapshot(cur_set, sql_str) Then
 Exit Sub
 End If
 

    CalendarControl.SetDataProvider WHAT SHOUD I PUT BASE ON THE INFO I TOLD YOU ALREADY?        
    
    
    If Not CalendarControl.DataProvider.Open Then
        CalendarControl.DataProvider.Create
    End If
   
    'm_eActiveDataProvider = eDataProviderType
       
    CalendarControl.Populate
    wndDatePicker.RedrawControl
 
 
This is a sample of the Database Connection Code:
 
 
Function ConnectJet(ByVal db_name As String, ByVal user_id As String, _
ByVal password As String, Optional ByVal ip_addr As String = "") As Boolean
    On Error GoTo ConnectJet_EH
    Set wCurWS = DBEngine.CreateWorkspace("DefaultWS", "Admin", "", dbUseJet)
   
    If password = "" Then
        Set dCurDB = wCurWS.OpenDatabase(db_name, False)
    Else
        Set dCurDB = wCurWS.OpenDatabase(db_name, False, False, ";pwd=" & password)
    End If
   
    Call goGeneral.MouseDefault
 
    sDatabase_nm = db_name            ' Database file name with path.
    sPathToDatabase = goGeneral.GetPath(db_name)
    ConnectJet = True
    Exit Function
 
ConnectJet_EH:
     db_name = UCase(db_name)
    goGeneral.DisplayBox db_name & goMessage.IS_NOT_FOUND
    sDatabase_nm = ""
    ConnectJet = False
    Exit Function
 End Function
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 11 November 2009 at 10:30am
Sounds like you need the custom data provider.  See the VB6 sample and look at the SQL Server code to see how.
Back to Top
arrozcon View Drop Down
Newbie
Newbie


Joined: 10 November 2009
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote arrozcon Quote  Post ReplyReply Direct Link To This Post Posted: 11 November 2009 at 6:45pm
Originally posted by SuperMario SuperMario wrote:

Sounds like you need the custom data provider.  See the VB6 sample and look at the SQL Server code to see how.
 
WHERE?
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2009 at 8:49am
Did you even look at the sample?  If you opened the sample it would be hard to miss.
Back to Top
arrozcon View Drop Down
Newbie
Newbie


Joined: 10 November 2009
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote arrozcon Quote  Post ReplyReply Direct Link To This Post Posted: 23 November 2009 at 10:42am

I download the demo and I look at the sample. I like the software and I'm willing to buy it but I still dont undestand how to use your code. Your code has a statement to open the database by the use of connectionstrings. I cannt use string to connect to my database because I already have a conection. I sue SQL statements to creade, delete and edit records only.

What I need is to use my data and put it on your calendar, as simple as that. I have my own table. My own record ids, etc. How I can do that?
 
I'm willing to pay anyone that can do that for me.

Thanks,
Jose
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 25 November 2009 at 9:11am
You can still use the custom data provider.  The calendar doesn't have to connect to the database.  In this case you can just tell it to use the custom provider.

Scripts for the tables the Calendar uses are here:
...\Calendar\VB\CalendarSample\SQLscripts

It doesn't matter how\where you store the data really, as long as you provide the calendar what it wants when it needs it.
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.125 seconds.