thetta er a ensku, en vona ad thetta skiljist….vantar sma hjalp :)

Hey

I'm writing my (almost) first Component and I'm kinda stuck for now, so I was wondering if some of you nice ppl out there would be able to gimme a hand.

The code works fine on the ASP page and does what it's supposed to be doing, but I wanted to convert it into a COM.

basically, I need the “FinalString” to be response.write on the ASP page

here's the code

Private Const strConnection As String = “Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=tin;Data Source=Vader”

Public Sub OnStartPage(ASP_Scripting_Context As ScriptingContext)

Set sContext = ASP_Scripting_Context

End Sub

Public Function GetFlash(RegionID As Integer, CategoryID As Integer, Loaded As Integer) As ADODB.Recordset

'DECLARING VARIABLES
Dim cn As New ADODB.Connection
Dim rs_Flash As New ADODB.Recordset
Dim strSQL As String
Dim intRegID As Integer
Dim intCatID As Integer
Dim rs_da_hub As New ADODB.Recordset
Dim rs_dots As New ADODB.Recordset
Dim xpos As String
Dim ypos As String
Dim blx As String
Dim bly As String
Dim blrotation As String
Dim blabel As String
Dim rs_dot_type As New ADODB.Recordset
Dim rs_listings As New ADODB.Recordset
Dim b_id As Integer
Dim b_name As String
Dim b_address As String
Dim b_city As String
Dim b_prov As String
Dim b_country As String
Dim b_post As String
Dim b_phone As String
Dim b_fax As String
Dim b_email As String
Dim b_web As String
Dim b_comments As String
Dim b_map As String
Dim rs_dot_swf_bridge As New ADODB.Recordset
Dim rs_swfs As New ADODB.Recordset
Dim swf_filename As String
Dim FinalString As String

'ASSIGNING VALUES TO REGION AND CATEGORY
intRegID = RegionID
intCatID = CategoryID
Loaded = Loaded

'DO STUFF
cn.Open strConnection
rs_Flash.CursorLocation = adUseClient

strSQL = “SELECT * FROM da_hub WHERE region_id = ‘” & intRegID & “’ AND cat_id = ‘” & intCatID & “’”
Set rs_da_hub = cn.Execute(strSQL)
strSQL = “”

Do While Not rs_da_hub.EOF

strSQL = “SELECT * FROM dots WHERE dot_id = ‘” & rs_da_hub.Fields(“dot_id”).Value & “’ AND dotxpos <> 0”
Set rs_dots = cn.Execute(strSQL)
strSQL = “”

Do While Not rs_dots.EOF

xpos = xpos & rs_dots.Fields(“dotxpos”).Value & “,”
ypos = ypos & rs_dots.Fields(“dotypos”).Value & “,”
blx = blx & rs_dots.Fields(“blx”).Value & “,”
bly = bly & rs_dots.Fields(“bly”).Value & “,”
blrotation = blrotation & rs_dots.Fields(“blrotation”).Value & “,”
blabel = blabel & rs_dots.Fields(“blabel”).Value & “,”

strSQL = “SELECT * FROM dot_type WHERE dot_type_id = ‘” & rs_dots.Fields(“dot_type_id”).Value & “’”
Set rs_dot_type = cn.Execute(strSQL)
strSQL = “”

Do While Not rs_dot_type.EOF

dot_type_id = dot_type_id & rs_dot_type.Fields(“dot_type_id”).Value & “,”

rs_dot_type.MoveNext
Loop


strSQL = “SELECT * FROM listings WHERE b_id = ‘” & rs_da_hub.Fields(“b_id”).Value & “’”
Set rs_listings = cn.Execute(strSQL)
strSQL = “”

Do While Not rs_listings.EOF

b_id = b_address & rs_listings.Fields(“b_id”).Value & “,”
b_name = b_name & rs_listings.Fields(“b_name”).Value & “,”
b_address = b_address & rs_listings(“b_address”).Value & “,”
b_city = b_city & rs_listings(“b_city”).Value & “,”
b_prov = b_prov & rs_listings(“b_prov”).Value & “,”
b_country = b_country & rs_listings(“b_country”).Value & “,”
b_post = b_post & rs_listings(“b_post”).Value & “,”
b_phone = b_phone & rs_listings(“b_phone”).Value & “,”
b_fax = b_fax & rs_listings(“b_fax”).Value & “,”
b_email = b_email & rs_listings(“b_email”).Value & “,”
b_web = b_web & rs_listings(“b_web”).Value & “,”
b_comments = b_comments & rs_listings(“b_comments”).Value & “,”

rs_listings.MoveNext
Loop

strSQL = “SELECT * FROM dot_swf_bridge WHERE dot_id = ‘” & rs_da_hub.Fields(“dot_id”).Value & “’”
Set rs_dot_swf_bridge = cn.Execute(strSQL)
strSQL = “”

Do While Not rs_dot_swf_bridge.EOF

strSQL = “SELECT * FROM swfs WHERE swf_id = ‘” & rs_dot_swf_bridge.Fields(“swf_id”).Value & “’”
Set rs_swfs = cn.Execute(strSQL)
strSQL = “”

Do While Not rs_swfs.EOF

swf_filename = swf_filename & rs_swfs.Fields(“swf_filename”).Value & “,”

rs_swfs.MoveNext
Loop

rs_dot_swf_bridge.MoveNext
Loop

rs_dots.MoveNext
Loop

rs_da_hub.MoveNext
Loop

butstate = “butstate=” & dot_type_id
xpos = “xpos=” & xpos
ypos = “ypos=” & ypos
blx = “blx=” & blx
bly = “bly=” & bly
blrotation = “blRotation=” & blrotation
b_name = “bName=” & b_name
blabel = “bLabel=” & blabel
b_address = “bAddress=” & b_address
b_city = “bCity=” & b_city
b_prov = “bProv=” & b_prov
b_country = “bCountry=” & b_country
b_post = “bPost=” & b_post
b_phone = “bPhone=” & b_phone
b_fax = “bFax=” & b_fax
b_email = “bEmail=” & b_email
b_web = “bWeb=” & b_web
b_comments = “bComments=” & b_comments
b_map = “bMap=” & intRegID
b_id = “bID=” & b_id
swf_filename = “bSwf=” & swf_filename
Loaded = “loaded=” & Loaded
amper = “&”

FinalString = amper & butstate & amper & xpos & amper & ypos & amper & blx & amper & bly & amper & blrotation & amper & b_name
FinalString = FinalString & amper & blabel & amper & b_address & amper & b_city & amper & b_prov & amper & b_country
FinalString = FinalString & amper & b_post & amper & b_phone & amper & b_fax & amper & b_email & amper & b_web & amper
FinalString = FinalString & b_comments & amper & b_map & amper & b_id & amper & swf_filename & amper & Loaded & amper

End Function

Public Function SpitOut(FlashString As String)

FlashString = FinalString

End Function


if you read this far…I thank you :) and hope you can gimme a hand.

Thanks

<br><br>- Moose ltd. -
- Moose ltd. -