Print Page | Close Window

Help with Connection to DB PLEASE!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=15582
Printed Date: 28 September 2024 at 6:11pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Help with Connection to DB PLEASE!
Posted By: arrozcon
Subject: Help with Connection to DB PLEASE!
Date 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



Replies:
Posted By: SuperMario
Date 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.


Posted By: arrozcon
Date 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?


Posted By: SuperMario
Date 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.


Posted By: arrozcon
Date 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


Posted By: SuperMario
Date 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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net