Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, August 24, 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: Create connection using ADO instead of GetNewConnection?
Mark Hanford
Posts: 131
 
Create connection using ADO instead of GetNewConnection?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Jul 08 11:10 AM
I'm having some trouble getting a connection working when I can't use Application.GetNewConnection (I'm going to be running as an agent task)

Sub UpdateScores()
Dim Conn
Dim ConnString

ConnString = "Provider=SLXOLEDB.1;Data Source=servername;Initial Catalog=dbname;...etc..."

Conn = CreateObject("ADODB.Connection")
Conn.Open ConnString

'...rest of sub...
End Sub

The problem is that my "Conn" is always set to an empty string on the CreateObject line above.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Create connection using ADO instead of GetNewConnection?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Jul 08 11:24 AM
So you mean that conn is a null or empty object, is that right? I just want to make sure you're not testing it as a string to see if things are OK (because it is not a string).

One thing I see in your code that is missing is you need to "set" the object reference when you use CreateObject.

Set Conn = CreateObject("ADODB.Connection")
Conn.Open ConnString


Make that change and give it a try. If it still doesn't work, are you getting any kind of error or anything?
[Reply][Quote]
Mark Hanford
Posts: 131
 
Re: Create connection using ADO instead of GetNewConnection?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Jul 08 5:10 AM
Heh, seems that rewriting the horrible old code (for the second time) was just too much for me at the end of the day.

In this case I had missed the "Set" out, so the Conn was being cast as a String("") - which confused me. It's been a while since I've dabbled with ADO :D

Thanks for the tip - luckily my omission survived the copying-and-simplify process for the example!
[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): 8/24/2025 7:11:02 AM