Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Thursday, June 19, 2025 
 
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!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: SQL 2005 and Application.GetNewConnection
Rob Bartram
Posts: 98
 
SQL 2005 and Application.GetNewConnectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Jul 07 5:14 PM
Hello,

I'm having trouble with the Application.GetNewConnection after migrating to SQL 2005.

A sample of my custom code that is producing the trouble is:

Dim strSQL

Dim objRS, objCN

Set objCN = Application.GetNewConnection

strSQL = "SELECT ColWidths, Misc FROM CEIUserGridSettings"
strSQL = strSQL & " WHERE UserID = 'ADMIN'"
strSQL = strSQL & " And PluginFamily = 'System'"
strSQL = strSQL & " And PluginName = 'Account Detail'"
strSQL = strSQL & " And ControlName = 'grdAttachments'"

Set objRS = objCN.Execute(strSQL)


The Error I'm getting on the objCN.Execute is:

-2147467259 Cannot open database "SALESLOGIX_USSLX2" requested by the login. The login failed.

The connection string for the objCN object at the time of error is:


Provider=SLXOLEDB.1;Integrated Security=""; Password=Password (not real password); Persist Security Info=True;User ID=admin;Initial Catalog=SALESLOGIX_USSLX2;Data Source=USSLX2;Extended Properties="PORT=1706;LOG=ON";Location="";Mode=ReadWrite

How I got to this point is:

We are migrating from SLX 6.2.6 on Windows 2000 Server/SQL 2000 to SLX 6.2.6 on Windows 2003 R2/SQL 2005 Enterprise running on a new box.

I installed Windows 2003 R2
I installed SQL Server 2005 Enterprise up to SP2
I installed SLX 6.2 from CD then upgraded to 6.2.6
I restored last night's backup of the production database (from SQL 2000)
I ran the "EXEC sp_change_users_login 'update_one', 'sysdba', 'sysdba'" command to reset the login name for sysdba.
I created a connection using the SLX server side connection manager tool called "Saleslogix_USSLX2" - I tried both of the provider options, and I'm currently using the Native SQL Client (it sensed that the server name had changed and prompted me to fix - I clicked OK to fix)
I launched SLX Administrator on the server, created a new client side connection configuration, and connected just fine.
I then went to a client PC and launched the SLX network client, setup the client side connection configuration for the new server, and connected fine, I just get the above error when retrieving data through our custom code using the GetNewConnection connection.

Any help would be very much appreciated
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: SQL 2005 and Application.GetNewConnectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Jul 07 9:37 PM
Did you install the "Native SQL Client" on the client PC? Note: it the client PC already had a DataLink you may need to delete the DataLink, then recreate the datalink, then reboot the client PC after you install the Native SQL Client.
[Reply][Quote]
Rob Bartram
Posts: 98
 
Re: SQL 2005 and Application.GetNewConnectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jul 07 8:35 AM
Thank you for your reply. From several of the articles I've read, I suspected that to be the problem, so I did install the Native SQL Client (after trying without) and restarted the PC. I then deleted and recreated the data link on the client PC, but the only OLE provider option was "Saleslogix OLE DB Provider". Should I also see "Native SQL Client" or does that get used by the Saleslogix OLE DB Provider behind the scenes?

[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: SQL 2005 and Application.GetNewConnectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jul 07 9:41 AM
Yes you should see Native SQL Client on the CONNECTION MANAGER link.....

The Data Link on the client PC links to the Connection Manager link via SLX OLE DB Provider.
[Reply][Quote]
Rob Bartram
Posts: 98
 
Re: SQL 2005 and Application.GetNewConnectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jul 07 11:33 AM
The connection in the connection manager is using the Native SQL Client. I'm a littls confused though, If the SLX Client communicates to the connection manager via the SLX OLE DB Provider, why is the Native Client required on the Client PC? I have installed the Native Client on the client PC, I'm just a little confused.

Anyway, If I run the same code ,modified to use the Saleslogix application object, through VB 6, all is good. The connection string (listed below) is a little different and I'm not sure why.

VB 6 Code

Dim strSQL
Dim ObjSLXClient
Dim objRS, objCN

Set ObjSLXClient = CreateObject("SalesLogix.SlxApplication")
Set objCN = ObjSLXClient.GetNewConnection

strSQL = "SELECT ColWidths, Misc FROM CEIUserGridSettings"
strSQL = strSQL & " WHERE UserID = 'ADMIN'"
strSQL = strSQL & " And PluginFamily = 'System'"
strSQL = strSQL & " And PluginName = 'Account Detail'"
strSQL = strSQL & " And ControlName = 'grdAttachments'"

Set objRS = objCN.Execute(strSQL)

CONNECTION STRING THROUGH SLX
Provider=SLXOLEDB.1;Integrated Security=""; Password=Password (not real password); Persist Security Info=True;User ID=admin;Initial Catalog=SALESLOGIX_USSLX2;Data Source=USSLX2;Extended Properties="PORT=1706;LOG=ON";Location="";Mode=ReadWrite

CONNECTION STRING THROUGH VB
Provider=SLXOLEDB.1;Integrated Security=""; Persist Security Info=False;User ID=admin;Initial Catalog=SALESLOGIX_USSLX2;Data Source=USSLX2;Extended Properties="PORT=1706;LOG=ON";Location="";Mode=ReadWrite
[Reply][Quote]
Rob Bartram
Posts: 98
 
Re: SQL 2005 and Application.GetNewConnectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jul 07 12:46 PM
I found the problem. The error was not at all related to Application.GetNewConnection. In the code snippets that I shared, I omitted some error handling code as I didn't think it was relevant. Well I was wrong. There was actually an error thrown somewhere else in our customizations that uses an external connection to circumvent the SLX security layer. This error was never caught and traveled all the way through the function I'm working with. Ughh!

Thank you all for your consideration to this problem and I humbly apologize for wasting your time.

Is there any way I can delete this thread?


[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: SQL 2005 and Application.GetNewConnectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Jul 07 3:47 AM
"The connection in the connection manager is using the Native SQL Client. I'm a littls confused though, If the SLX Client communicates to the connection manager via the SLX OLE DB Provider, why is the Native Client required on the Client PC? I have installed the Native Client on the client PC, I'm just a little confused"

SLX Client makes several connections - not just to the SLX provider but also directly to the database server (for speed purposes).

The SLX client looks back to the SLX server to see what the connection manager is defined as using in terms of OLEDB Connectivity to the DB Server. So, if in the Connection Manager on the server you have specified to use the MSSQL OLEDB Provider then this is what the SLX Client will use. On the SLX Client - there is no way/point to define how to connect to the database - that's why the SLX Client looks to the server for that information. It also means you only need to define the connection once, the SLX clients inherit that information/connection method from the server.

Fortunately, in Win XP SP1 and above all this "connection glue" was provided by MDAC (Microsoft Data Access Components). Unfortunately, this is not the case if you are using the MS Native Client for SQL2005. You must install that separately using the sqlncli.msi.

Hope that helps !
Mike
[Reply][Quote]
Rob Bartram
Posts: 98
 
Re: SQL 2005 and Application.GetNewConnectionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Jul 07 6:25 AM
Mike, thank you very much for that explaination. It is now crystal clear.

...Rob
[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 © 2025 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): 6/19/2025 4:41:29 PM