Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Administration Forums - Mobile/PDA/Handhelds
Forum to discuss use of SalesLogix with mobile devices including SalesLogix mobile and other mobile solutions. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Mobile/PDA/Handhelds | New ThreadView:  Search:  
 Author  Thread: How to make a DB connection
Mallikarjun
Posts: 32
 
How to make a DB connectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Aug 08 7:14 AM
Hi,
I am rtying to make a DB connection and fetch data of a particular field based on some event like click of a buton. Can any body suggest me on how to proceed on this. I am not finding any hint from the existing code or architect on how to start this task.

Thanks in advance

Mallikarjun
[Reply][Quote]
Harendra Sinha
Posts: 66
 
Re: How to make a DB connectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Aug 08 1:16 PM
.. script file is available in SalesLogix for this
include that file in your form
'Including Script - System:SLX Database Support



dim objDB
dim objSLXDB
dim objRS
Set objDB = New SLX_DB
Set objSLXDB = new SLX_DB
Set objRS = objSLXDB.GetNewRecordset


'exception handling for connection while creating recordset
If ErrorCheck (Application.Translator.Localize("Error getting connection information:")) > 0 Then Exit sub

strSQL = "SELECT count(contactid),sum(AccountValue) from DI_AssetSummary where userId = '"& strUserId &"' and " &_
" contactId = '" & strContactID & " ' "

'Get a RecordSet object for the given SQL query
objRS.Open strSQL, objSLXDB.Connection

'exception handling for while accessing database
If ErrorCheck (Application.Translator.Localize("Error accessing database:")) > 0 Then
objRS.Close
Set objRS = Nothing
Exit sub
End If



If (Not objRS.BOF) And (Not objRS.EOF) Then
iTotalRecords = objRS.Fields(0).Value
fTotalValue = objRS.Fields(1).Value
End If



or you can define your own connection string as follows..

dim objConnection
dim strConnection

Set objConnection = CreateObject("ADODB.Connection")
strConnection = "Provider=sqloledb;Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsernameassword=myPassword;"

objConnection.Open strConnection
(you can change the strConnection as your requrement)


HOPE THIS WILL HELP YOU.
-Harendra
[Reply][Quote]
Mallikarjun
Posts: 32
 
Re: How to make a DB connectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Aug 08 11:13 PM
Hi Harendra,

I dont think so it is for black berry client i feel you are talking about LAN client or Web client. I am working on Blackberry client. Correct if i am worng.

Regards
Mallikarjun
[Reply][Quote]
Mark Dykun
Posts: 297
 
Re: How to make a DB connectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Aug 08 7:08 AM
The example provided is definately lan script code and does not refer to Java BB device code. You will have to look into some of the java classes for examples of this specifically. You will need to use the query object to get back what you are looking for. Currently I do not have time to come up with an example but there should be enough to go on in existing core code to muck your way through.

Mark
[Reply][Quote]
Harendra Sinha
Posts: 66
 
Re: How to make a DB connectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Aug 08 9:10 AM
Mallikarjun,
sorry !!! my misunderstanding...

-harendra
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/22/2024 9:06:14 PM