Login / Register  search  syndication  about

          Ryan Farley's Blog

Ryan Farley on .NET Development with a focus on CRM Development for SalesLogix

More on CursorLocation with SalesLogix

In response to my last post, Jeremy Brayton asked an important enough question that I felt warranted another post on the subject.

Does the provider default to client side now? Or do we have to explictely call this. My guess would be no, that it ADO recordsets default to server side and they can't be altered.

As Jeremy mentioned, it's not the SalesLogix provider that provides the defaults, it is the ADO objects that do. The ADO Recordset object defaults to a server-side cursor when none is explicity set. So you will need to add the line to set the client-side cursor.

One other thing to note. A common shortcut for opening up a recordset is to execute a query using a Connection object, such as the following:

Set objRS = Application.GetNewConnection.Execute("select * from contact")

You really shouldn't do this since this method uses the ADO defaults, which means a server-side cursor. You really should create a Recordset object and open normally so you are able to specify a client-side cursor as the code below demonstrates:

Dim objRS

    Set objRS = CreateObject("ADODB.Recordset")
    objRS.CursorLocation = adUseClient
    objRS.Open "select * from contact", Application.GetNewConnection

Small changes in the provider, really only to enforce what has always been the case with the SalesLogix provider. The best route is to do what SalesLogix does. Make a generic script that returns to you a recordset. Then anytime you need one you get it from that generic script. Or you could use the script that SalesLogix uses for their own customizations (See the GetNewRecordset function in the SLX_DB class which can be located in the System:SLX Database Support plugin.

What's This?
  
Bookmark and Share

About Ryan Farley

   Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix since 2001 and believes in sharing with the community. He loves C#, Javascript, Python, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

View the SalesLogix Mobile Seveloper Series
View the SalesLogix SData Developer Series
View the Git for the SalesLogix Developer series



Related Content
   Using a Test Plan
So you have approved the Statement of Work (SOW) for some modifications and are awaiting the delivery of
Posted on Mar 13, 2014 by George Jensen to George Jensen's Blog
 
   Creating a Saleslogix Ticket Pretty Prefix and Suffix in External Applications
Some entities in SalesLogix, such as Tickets, use a "pretty key" as an easier to use value to r
Posted on Feb 28, 2014 by Ryan Farley to Ryan Farley's Blog
 
   Evaluating strings in C# Code snippets
When checking for two (or more) different values for a property in a code snippet, you can't simply l
Posted on Dec 13, 2013 by Jason Buss to Jason Buss' Blog
 
   Updates to the SalesLogix Mobile Developer Toolkit
I've released some updates to the SalesLogix Mobile Developer Toolkit. This new release adds some fix
Posted on Apr 10, 2013 by Ryan Farley to Ryan Farley's Blog
 
   Free Tool to Retrieve SalesLogix User Names and Passwords
As a business partner we work with customer SalesLogix databases often. Along with getting a database bac
Posted on Feb 25, 2013 by Ryan Farley to Ryan Farley's Blog
 
Comments

 

Jiho Han said:

Well the default seems to have been set to adUseClient.

Set objConn = Application.GetNewConnection
Set objRS = objConn.Execute("SELECT * FROM CONTACT WHERE CONTACTID = '" & Application.BasicFunctions.CurrentContactID & "'")
MsgBox objConn.CursorLocation & ", " & objRS.CursorLocation

The msgbox will report "3, 3" - meaning CursorLocation.
This was not the case for RC2 when I tested it. I am guessing they did this for backward compatibility - it would have broken a lot of existing pre-6.2 code who were upgrading to 6.2.
September 29, 2004 1:16 PM
 

Ryan Farley said:

Well that is good news. I'll start some testing on that also. Thanks Jiho.
September 29, 2004 9:56 PM

Leave a Comment

(required)  
(optional)
(required)  
Add
All contents Copyright © 2014 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register