11/22/2024 3:56:40 PM
|
|
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 the SalesLogix OLE DB Provider from external applications (including usage of built-in provider procedures). View the code of conduct for posting guidelines.
|
|
|
|
SLX_DBIDS Understanding...
Posted: 28 Aug 06 1:12 PM
|
fiogf49gjkf0d I'm starting to venture out more and more as the integration tasks keep gowing as I complete one..
I'm looking over the information Ryan posted about the SLX_DBID's and thought I understood it. I look at Stephens Function and liked the concept..
So now I am wondering With the following code.. how do I pickout the id for my inserts...
--------------------------------- Function CreateSlxID(ByVal Table As String, ByVal Q As Integer) As Data.OleDb.OleDbDataReader Dim SlxConn2 As New OleDb.OleDbConnection Dim cmd As New OleDb.OleDbCommand("slx_dbids('" & Table & " ', " & Q & ")", SlxConn2) SlxConn2.ConnectionString = "Provider=SLXOLEDB.1;Data Source=;Initial Catalog=QASales;User Id=assword=;" & _ "Persist Security Info=True;Extended Properties = Port=1706;Log=On" SlxConn2.Open() CreateSlxID = cmd.ExecuteReader() SlxConn2 = Nothing End Function
I cleaned the source and items as my connection string is working correctly
So when I call this function..
sNewId = CreateSlxID("C_MyTable", 10)
How do I get id number 6..??
Thanks
Rich |
|
|
|
Re: SLX_DBIDS Understanding...
Posted: 28 Aug 06 1:54 PM
|
fiogf49gjkf0d The return is a recordset with the number of items you requested (10). You would then just loop through the recordset and look for the 6th value.
For a visualization, just run the procedure in Query Analyzer. It returns the recordset just as if you ran it in your .NET app. |
|
|
|
Re: SLX_DBIDS Understanding...
Posted: 28 Aug 06 6:42 PM
|
fiogf49gjkf0d This function returns an OleDbDataReader. The reader has a single column named "ID" with as many rows as you specified in the Q param for the number of ID values to create.
You can then loop through the rows to get the ID value on each. For example:
OleDbDataReader r = CreateSlxID("account", 10); string msglist = string.Empty; while (r.Read()) { msglist += r.GetString(0) + Environment.NewLine; } MessageBox.Show(msglist);
If you wanted you could modify the function to return some other object, like a DataTable or something, but a reader should work fine for this scenario. |
|
|
|
Re: SLX_DBIDS Understanding...
Posted: 28 Aug 06 6:47 PM
|
fiogf49gjkf0d Originally posted by Jeremy Brayton
For a visualization, just run the procedure in Query Analyzer. It returns the recordset just as if you ran it in your .NET app. |
|
That will work with a query tool that can connect via OLEDB, but not with QA. QA makes direct SQL connection, so the SLX_DBIDS proc will not be found as it is not a real proc, but more of a virtual one that is implemented in the SLX Provider. There are some good OLEDB Query Tools out there. I have my own that I keep dumping work into (which I hope to release at some point, but it's one of many items on a very long list ) |
|
|
|
Re: SLX_DBIDS Understanding...
Posted: 30 Aug 06 1:30 AM
|
fiogf49gjkf0d Originally posted by Ryan Farley
There are some good OLEDB Query Tools out there. I have my own that I keep dumping work into (which I hope to release at some point, but it's one of many items on a very long list ) |
|
Ryan, any recommendations for the tools that are out there?
Jeff
|
|
|
| |
| |
|
Re: SLX_DBIDS Understanding...
Posted: 30 Aug 06 3:49 PM
|
fiogf49gjkf0d Besides my own that is currently in the works, I prefer QueryExpress (See http://www.albahari.com/queryexpress.html). The reason I like this one is because, besides being free, all source is available and it is in C#. I've modified the source to make it more SLX centric. I've added a few things to it that enchance it for SLX. However, I abandoned it to make my own that is built to be SLX specific (but like I said, it's one of many on a long list of projects ).
Some others that are nice are ADOExplorer (See http://www.peyo-home.sk/) that Frank Mentioned, although not free. This one is popular among some of the BPs. ADO Query Tool is nice, but has some issues with the SLX Provider (See http://gpoulose.home.att.net/). The C++ source is available for an older version. I made some tweaks to that version to get it to work better with SLX, but I stopped using it for QueryExpress. |
|
|
|
Re: SLX_DBIDS Understanding...
Posted: 31 Aug 06 12:19 AM
|
fiogf49gjkf0d Thanks Frank & Ryan. When I worked in PSG at Sage, I got them to buy a couple o' licenses for ADO Explorer, simply b/c I couldn't find much else that I liked at the time. I thought the UI was a little weird and non-intuitive, but it got the job done.
I've downloaded query express, and while it's simple, it seems to be straightforward. I'll probably use that since a) it's free, and b) I don't need to run a lot of queries with the SLX security, date time handling, etc. applied.
Ryan, if you ever get your query tool working and want to share, I'd love to try it out.
Thanks,
Jeff |
|
|
|
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!
|
|
|
|
|
|
|
|