Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 2024 
 
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 - ADO General
Forum to discuss ADO specific questions for use with SalesLogix. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to ADO General | New ThreadView:  Search:  
 Author  Thread: inserting recoed in SQL Database through SLX
satz
Posts: 75
 
inserting recoed in SQL Database through SLXYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jan 08 10:05 AM
hello friends,

i have problem in inserting recoed in SQL Database through SLX. i want to know my syntax is correct. please help me.
here is my code...


Dim strlstrsql
set rsobjCMC = objSLXDB.GetNewRecordSet

strlstrsql = "Select * from Contact_Newletter where 1=2" 'DNL

rsobjCMC.Open strlstrsql, objSLXDB

with rsobjCMC
.addnew
.Fields("Contact_newletterid").Value=application.BasicFunctions.GetIDFor("Contact_Newletter")
.Fields("CreateUser").Value = Application.BasicFunctions.CurrentUserID
.Fields("CreateDate").Value = now
.Fields("ModifyUser").Value = Application.BasicFunctions.CurrentUserID
.Fields("ModifyDate").Value = now
.Fields("Subscribed").Value = "C"
.Update
End With
[Reply][Quote]
Rohan Verghese
Posts: 40
 
Re: inserting recoed in SQL Database through SLXYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jan 08 10:15 AM
Only issue I can see is that it should be:

rsobjCMC.Open strlstrsql, objSLXDB.Connection
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: inserting recoed in SQL Database through SLXYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jan 08 2:36 PM
As Rohan mentioned, this line:

rsobjCMC.Open strlstrsql, objSLXDB


is incorrect. Change as mentioned by Rohan or like this:

rsobjCMC.Open strlstrsql, Application.GetNewConnection


Either way should work.

-Ryan
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: inserting recoed in SQL Database through SLXYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jan 08 4:26 PM
Recent versions of the OLE DB provider (7 onwards?) perform the update of CREATEUSER, CREATEDATE, MODIFYUSER and MODIFYDATE automatically - so your code can be condensed to the following:

Dim strlstrsql
set rsobjCMC = objSLXDB.GetNewRecordSet

strlstrsql = "Select * from Contact_Newletter where 1=2" 'DNL

rsobjCMC.Open strlstrsql, objSLXDB.Connection

with rsobjCMC
.addnew
.Fields("Contact_newletterid").Value=application.BasicFunctions.GetIDFor("Contact_Newletter")
.Fields("Subscribed").Value = "C"
.Update
End With

Phil
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: inserting recoed in SQL Database through SLXYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Jan 08 6:11 PM
..On THIS site also look at:
http://slxdeveloper.com/page.aspx?id=35&articleid=76

--
RJLedger - rjlSystems
[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 © 2024 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): 11/22/2024 4:54:45 PM