11/22/2024 3:55:08 AM
|
|
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!
Forum to discuss using SQL SSIS or DTS to perform SalesLogix imports. View the code of conduct for posting guidelines.
|
|
|
|
Just trying to get a simple DTS Package Setup
Posted: 26 May 09 8:33 PM
|
Hi, I am trying to setup a very simple DTS Package but not matter what I try I receive the following error message:
"Could not connect to source component" "Error opening rowset"
I am using the SalesLogix provider as the source and destination, test connections run fine, I indicate the table to copy to and from. (I setup a simple two field table to just try to troubleshoot.) Once I execute the package this error always appears. Everything else within SalesLogix runs fine and has for quite some time.
Any suggestions are greatly appreciated.
Thank you in advance. |
|
|
|
Re: Just trying to get a simple DTS Package Setup
Posted: 26 May 09 9:15 PM
|
It's been a while (I use SSIS now), but I remember that I always used ActiveX scripts in DTS to do anything which relied on the SLX provider. Integration between the standard DTS task components and the SLX provider was not, erm, completely implemented, to be euphemistic about it.
What is your actual requirement here? I presume it's not just copying records ... doing this would result in issues with IDs, for one thing.
I can help you with some code, I'm sure.
Phil |
|
|
|
Re: Just trying to get a simple DTS Package Setup
Posted: 26 May 09 9:37 PM
|
Phil,
First, thanks so much for the reply.
I am actually trying to do some pretty simple stuff.
I need to update one column in a table from another database every few hours but need to make sure this gets written to TEFs for the remote clients. I already have a relationship established between SalesLogix DB and this second database on another SQL server. (The other DB will contain the Account ID and Opportunity ID from SalesLogix as it is the sysdba.Opportunity table I need to update.)
Second task is to populate/update views I have in SalesLogix to just display data from the other financial database which I already have coded to obtain the correct Account ID - as it is a one to many type view to show financial data for each Account in the accounting system.
Let me know what you think.
Julie |
|
|
|
Re: Just trying to get a simple DTS Package Setup
Posted: 26 May 09 10:47 PM
|
No problem.
Your second task: sorry if I am stating the obvious, but if these are true views which are pulling data from another system, your remotes will not be able to see them.
Task 1 sounds simpler than it is, I'm afraid.
The way that I have done this is via an ActiveX script, or scripts, as I mentioned before. Here is an overview of the method I used:
1) Use a SQL connection (not SLXOLEDB) to execute a query, returning a recordset of all the records that you need to update (for simplicity, I'll assume that this recordset contains OpportunityID and a field called F1, also on Opportunity).
2) Loop through this recordset one record at a time, updating the records as you go (this time using an SLX OLEDB connection). You perform the updates explicitly, row by row, to ensure that they are sync'd to remotes. Here is a code snippet:
'Pull the SLX connection string from a global variable - then only need to change the GV once when the server changes strConn = DTSGlobalVariables("SLXConnectionString").Value
Set objConn=CreateObject("ADODB.Connection") objConn.open strConn
'Pull the SQL connection string from a global variable - then only need to change the GV once when the server changes 'This is needed to execute SELECT across servers strConn2 = DTSGlobalVariables("SQLConnectionString").Value
Set objConn2=CreateObject("ADODB.Connection") objConn2.open strConn2
'We then loop round the resultset and execute an UPDATE command for every occurrence
'First, set the SQL that will retrieve the required resultset
strSQL2 = "cross database select query here returning OpportunityID and F1"
'Run this SQL using a SQL connection set objRS2 = CreateObject("ADODB.Recordset") 'Open the recordset and cycle round it, updating as we go objRS2.open strSQL2, objConn2, 3 '3 - adOpenStatic - try to avoid recordset locks do with objRS2 do while not (.bof or .eof) strSQL = "update Opportunity set F1 = '" & .fields("F1").value & "' where OpportunityID = '" &_ .fields("OpportunityID").value & "'" objConn.execute strSQL .MoveNext loop .close .open strSQL2, objConn2, 3 '3 - adOpenStatic - try to avoid recordset locks end with loop until (objRS2.bof or objRS2.eof) objRS2.close
Obviously, variables are used to hold the connection strings.
Don't forget to tidy up at the end:
'Tidy up set objRS2 = nothing objConn.close set objConn = nothing objConn2.close set objConn2 = nothing
|
|
|
|
Re: Just trying to get a simple DTS Package Setup
Posted: 27 May 09 9:24 AM
|
Thanks so much.
For the second item I was going to pass data from the other SQL database into other tables in the SalesLogix DB using a scheduled stored procedure run once a day and I was hoping the SalesLogix database could contain views that look at this data that is also synced out to the remotes. Sorry for the confusion.
|
|
|
|
Re: Just trying to get a simple DTS Package Setup
Posted: 27 May 09 9:50 PM
|
When the stored procs run, any data which they transfer will not be sync'd to remotes. The fact that you have created a view of which the SLX provider is aware does not mean that the data referenced by that view will be sync'd out.
So the remotes would see the view, but not the data.
To get the data sync'd out, you need to do row-by-row explicit INSERTS to SLX tables using the SLX provider, as exemplified in my previous post.
By explicit, I mean of the following form:
INSERT INTO OPPORTUNITY(F1, F2, Fn) SELECT 'str1', 'str2', 'strn'
rather than
INSERT INTO OPPORTUNITY(F1, F2, Fn) SELECT Ex1.F1, Ex1.F2, Ex1.Fn FROM ExternalTable Ex1 WHERE [condition]
Hope that makes sense!
Phil
|
|
|
| |
|
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!
|
|
|
|
|
|
|
|