Help with Connection to DB PLEASE! |
Post Reply |
Author | |
arrozcon
Newbie Joined: 10 November 2009 Status: Offline Points: 6 |
Post Options
Thanks(0)
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 |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Sounds like you need the custom data provider. See the VB6 sample and look at the SQL Server code to see how.
|
|
arrozcon
Newbie Joined: 10 November 2009 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
WHERE?
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Did you even look at the sample? If you opened the sample it would be hard to miss.
|
|
arrozcon
Newbie Joined: 10 November 2009 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
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
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
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. |
|
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 |