SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 7th, 2001, 07:40 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
ASP and COM

<i><b>Originally posted by : Rick M (rick.mcdonnell@eds.com)</b></i><br />Hi,<br /><br />Can someone share a VB COM class that is used with ASP and SQL?<br /><br />Thanks,<br />Rick

Reply With Quote
  #2  
Old May 8th, 2001, 01:32 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : notimportant (jhunt@alagreen.com)</b></i><br /><br />'this is used to call a single row<br />'from a SQL7 - 2000 table<br />'I call this <tablename.load><br />'this table is named criteria<br />'mvarcriteriaid is the unique id for the row<br />'imvarevalid is the key<br />'_______________<br />Private mvarcriteriaid As Integer 'local copy<br />Private mvarevalid As Integer 'local copy<br />Private mvarjob_title As String 'local copy<br />Private mvarjob_summary As String 'local copy<br /><br />Public Property Let criteriaid(ByVal vData As Integer)<br /> 'used when assigning a value to the property, on the left side of an assignment.<br /> 'Syntax: X.criteriaid = 5<br /> mvarcriteriaid = vData<br />End Property<br />Public Property Get criteriaid() As Integer<br />'used when retrieving value of a property, on the right side of an assignment.<br />'Syntax: Debug.Print X.criteriaid<br /> criteriaid = mvarcriteriaid<br />End Property<br />Public Property Let evalid(ByVal vData As Integer)<br /> 'used when assigning a value to the property, on the left side of an assignment.<br /> 'Syntax: X.evalid = 5<br /> mvarevalid = vData<br />End Property<br />Public Property Get evalid() As Integer<br />'used when retrieving value of a property, on the right side of an assignment.<br />'Syntax: Debug.Print X.evalid<br /> evalid = mvarevalid<br />End Property<br />Public Property Let job_title(ByVal vData As String)<br /> 'used when assigning a value to the property, on the left side of an assignment.<br /> 'Syntax: X.job_title = 5<br /> mvarjob_title = vData<br />End Property<br />Public Property Get job_title() As String<br />'used when retrieving value of a property, on the right side of an assignment.<br />'Syntax: Debug.Print X.job_title<br /> job_title = mvarjob_title<br />End Property<br />Public Property Let job_summary(ByVal vData As String)<br /> 'used when assigning a value to the property, on the left side of an assignment.<br /> 'Syntax: X.job_summary = 5<br /> mvarjob_summary = vData<br />End Property<br />Public Property Get job_summary() As String<br />'used when retrieving value of a property, on the right side of an assignment.<br />'Syntax: Debug.Print X.job_summary<br /> job_summary = mvarjob_summary<br />End Property<br />'_________________________________<br />'I call this <tablename.actions><br />'both of there live in the same .dll<br /><br />Function Selectcriteria(intEvalId As Integer) As Object<br />Dim objCmd As New ADODB.Command<br />Dim objRs As New ADODB.Recordset<br />Dim objcriteria As New load<br />' Open a connection<br />Dim objConn As New ADODB.Connection<br />With objConn<br />.Properties("Data Source") = "odbc source"<br />.Properties("User Id") = "user id"<br />.Properties("Password") = "password"<br />.Open<br />End With<br />'I am using a stored procedire but you could use a select statment<br />With objCmd<br />.ActiveConnection = objConn<br />.CommandType = adCmdStoredProc<br />.CommandText = "usp_SELECTcriteria"<br />.Parameters("@intcriteriaid") = intEvalId<br />End With<br /><br />Set objRs = objCmd.Execute<br />If objRs.EOF Or objRs.BOF Then<br />'error code here.....<br />Else<br /> With objcriteria<br /> .criteriaid = objRs("criteriaid").Value<br /> .evalid = objRs("evalid").Value<br /> .job_title = objRs("job_title").Value<br /> .job_summary = objRs("job_summary").Value<br /> End With<br />End If<br />Set Selectcriteria = objcriteria<br />End Function<br /><br />'______________________________<br />'ASP CALL<br />dim objCriteriaFlds,objCriteria<br />set objCriteriaFlds = createobject("criteria.load")<br />set objCriteria = createobject("criteria.actions")<br />set objCriteriaFlds = objCriteria.Selectcriteria(CInt(intUniqueRowId))<br /><br />_________________<br /><HTML><br /><BODY><br /><input name="job_title" value="<%= objCriteriaFlds.job_title %>"></input><br /><input name="job_title" value="<%= objCriteriaFlds.job_summary %>"></input><br /></BODY><br /></HTML><br /><br />Hope this helps<br />Have fun!

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > ASP and COM


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT