webForumDet fria alternativet

Server.CreateObject Failed

6 svar · 462 visningar · startad av aleborg

aleborgMedlem sedan jan. 20013 341 inlägg
#1

Jag får följande fel:
Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/shop/pay.asp, line 10

800401f3

på koden:

Set pay = Server.CreateObject("aShop.Order")

Klassen order finns och på andra sidor kör jag t ex:

Set cart = Server.CreateObject("aShop.Cart")

och det fungerar utan problem, "Order" existerar i DLL:en samt fungerar(provat kalla på den från ett .exe projekt utan problem, alla funktioner samt subbar fungerade också)

Blir tokig på det här har sökt igenom alla filer, testat att enbart köra:
Set pay = Server.CreateObject("aShop.Order")
utan att kalla på funktioner och subbar i DLL:en men med samma resultat :(

ToonsterMedlem sedan feb. 20001 590 inlägg
#2

Kan det vara så att komponenten gör något som den inte har rättighet till? Kanske krävs något annat för att den ska fungera, en viss mapp, eller en textfil?

aleborgMedlem sedan jan. 20013 341 inlägg
#3

nix, inget sånt, den bara lägger till i databasen, samma kod som i alla andra klasser!

@ndersMedlem sedan juni 200032 969 inlägg
#4

Ibland efter omkompilering av projekt i VB ligger gamla dll-referenser kvar i registret. Stäng av webbtjänsten, radera alla dll:er och kör RegClean eller annat registerrensningsprogram, och kompilera sedan om.

Mvh,

AddeladdeMedlem sedan jan. 20013 406 inlägg
#5

Har du lagt filen i system32 katalogen.
Registrerat dll-filen i dos och sedan startat om datorn

Borde fungera då tycker jag!

aleborgMedlem sedan jan. 20013 341 inlägg
#6

Har startat om datorn o lagt in DLL:en på nytt men samma meddelande :(

aleborgMedlem sedan jan. 20013 341 inlägg
#7

häll i er nu...

kalssen "Order"

Option Explicit
Public resell As String
Public moms As String
Public User_ID As Integer
Public webshop As String
Public SPass As String
Public ResellerPath As String
Dim sComment As String
Dim sCompany As String
Dim sName As String
Dim sAddress1 As String
Dim sAddress2 As String
Dim sZip As String
Dim sCity As String
Dim sCountry As String
Dim sState As String
Dim sIP As String
Public objConn As Object

'Connectionstring to the db
'----------------------------------------------------------------------------------
Private Property Get ConnectionString()
    ConnectionString = "Driver={Mysql};Server=10.0.0.1;Database=aShop;UID=test;PWD=test"

End Property

'Destry the object
'----------------------------------------------------------------------------------
Public Sub DestroyObject(ByRef obConn As ADODB.Connection)
   If IsObject(obConn) Then
          obConn.Close
          Set obConn = Nothing
    End If
End Sub

'Open the DB
'----------------------------------------------------------------------------------
Public Function GetConn() As ADODB.Connection
    Dim ojConn As ADODB.Connection
    
    Set ojConn = CreateObject("ADODB.Connection")
    ojConn.Open ConnectionString
    Set GetConn = ojConn

End Function

'Reseller Querystring?
'----------------------------------------------------------------------------------
Public Sub Reseller(Optional id)
    Dim Property As New Property
    If id <> "" Then
        resell = Property.ResellerQueryStr(CInt(id))
    Else
        resell = "?res="
    End If
End Sub

'Reseller Path
'----------------------------------------------------------------------------------
Public Sub ResellPath(Optional id As Integer)
    If id > 0 Then
        ResellerPath = id & "\"
    Else
        ResellerPath = ""
    End If
End Sub

'Show/hide Vat
Public Sub Vat(momsen As String)
    moms = momsen
End Sub

'Is the user logged in?
Public Sub User_Logged(id As Integer)
    User_ID = id
End Sub

'get shop username
Public Sub ShopID(shoppen As String)
    webshop = shoppen
End Sub

'get shop password
Public Sub ShopPass(shoppen As String)
    SPass = shoppen
End Sub

Public Property Let Save_Comment(data As String)
    sComment = data
End Property
Public Property Let Save_Company(data As String)
    sCompany = data
End Property
Public Property Let Save_Name(data As String)
    sName = data
End Property
Public Property Let Save_Address1(data As String)
    sAddress1 = data
End Property
Public Property Let Save_Address2(data As String)
    sAddress2 = data
End Property
Public Property Let Save_Zip(data As String)
    sZip = data
End Property
Public Property Let Save_City(data As String)
    sCity = data
End Property
Public Property Let Save_Country(data As String)
    sCountry = data
End Property
Public Property Let Save_State(data As String)
    sState = data
End Property
Public Property Let Save_IP(data As String)
    sIP = data
End Property

'Get Cart Items
'----------------------------------------------------------------------------------
Public Function SaveCart(cart_user As String)
    'Dim Misc As New Misc
    Dim disc As Recordset
    Dim RS As Recordset
    Dim mSQL As String
    Dim SQL As String
    Dim sdSQL As String
    Dim strMisc
    Dim i As Integer
    Dim Property As New Property
    Dim TheShop
    Dim ordern As Integer
    Dim oSQL As String

    'get shop id
    TheShop = Property.GetWebshop(webshop, SPass)

        'get cart items
        Set objConn = GetConn()
        mSQL = "Select Cart_Prod_ID, Cart_User_ID, Cart_Items, Cart_ID From Cart Where Cart_Webshop=" & CInt(TheShop(0, 0)) & " And Cart_User_ID='" & cart_user & "'"
        Set disc = objConn.Execute(mSQL)
        'check if there's anything in the db
        If Not disc.EOF Then
            strMisc = disc.GetRows()
        Else
            strMisc = Null
        End If
        disc.Close
        Set disc = Nothing
        Call DestroyObject(objConn)

        'check if there is any products in the cart
        If Not IsNull(strMisc) Then
            Set objConn = GetConn()

            oSQL = "Insert Into Orders"
            oSQL = oSQL & "(Order_User, Order_Webshop, Order_Date, Order_IP, Order_Comment, Order_Company, Order_Name, Order_Address1, Order_Address2, Order_Zip, Order_City, Order_Country, Order_State)"
            oSQL = oSQL & "VALUES(" & User_ID & ", " & CInt(TheShop(0, 0)) & ", '" & Now() & "', '" & sIP & "', '" & sComment & "', '" & sCompany & "', '" & sName & "', '" & sAddress1 & "', '" & sAddress2 & "', '" & sZip & "', '" & sCity & "', '" & sCountry & "', '" & sState & "')"

            objConn.Execute (oSQL), , 128

            Set RS = objConn.Execute("select last_insert_id()")
            ordern = RS(0)

            RS.Close
            Set RS = Nothing

            Call DestroyObject(objConn)

            'loop and replace
            For i = 0 To UBound(strMisc, 2)
             Set objConn = GetConn()

                'save the order items
                SQL = "Insert Into OrderItems"
                SQL = SQL & "(OI_Prod, OI_Order, OI_Items)"
                SQL = SQL & "VALUES(" & strMisc(0, i) & ", " & ordern & ", " & strMisc(2, i) & ")"
                objConn.Execute (SQL), , 128
            Call DestroyObject(objConn)
            Next

            Set objConn = GetConn()
            sdSQL = "Delete From Cart Where Cart_Webshop=" & CInt(TheShop(0, 0)) & " And Cart_User_ID='" & cart_user & "'"
            objConn.Execute (sdSQL), , 128
            objConn.Execute ("Optimize Table Cart")
            Call DestroyObject(objConn)

            'send it back
            SaveCart = True
       Else
            'send it back
            SaveCart = False
       End If
   
    
    'send it back

    

End Function

'lets print the page
Public Function page()
    Dim Property As New Property
    Dim TheShop
    Dim Category As New Category
    Dim ThePage As String

    'make sure the shop is allowed to be used and get some info
    TheShop = Property.GetWebshop(webshop, SPass)

    'Does the Webshop exists?
    If Not IsNull(TheShop) Then
        'Is The Webshop Active????
        If TheShop(4, 0) = 0 Then

            'Let's get the template
            ThePage = Property.GetTemplate("pay.htm", CStr(TheShop(2, 0)), ResellerPath)

            'Common replaces
            ThePage = Property.CommonReplaces(CInt(TheShop(0, 0)), ThePage, "" & CStr(TheShop(1, 0)), moms, "pay.asp", resell)

        Else
            'The Webshop is closed by Admin
            ThePage = "<font face=""Verdana"" size=""2""><b>Error!</b><br>This webshop is not active, please contact the server administrator.</font>"
        End If

    Else
        'shop not found
        ThePage = "<font face=""Verdana"" size=""2""><b>Error!</b><br>Please check the ShopID and Password. If the error remains, please contact the server administrator.</font>"
    End If

    page = ThePage
End Function

asp filen "pay.asp":

<!--#include file="config.asp" -->
<%
Dim resell
Dim sorder

If Session("User_ID") = "" Or Session("User_ID") = False Then
	Response.Redirect "login.asp?"& Request.ServerVariables("QUERY_STRING")
End If

Set pay = Server.CreateObject("aShop.Order")
	
	'check reseller
	If Request.Querystring("res") <> "" Then
		resell = Cint(Request.Querystring("res"))
		Call pay.ResellPath(Cint(Request.Querystring("res")))
	End If
	Call pay.Reseller(resell)
	
	'check vat
	If Request.Cookies("aSHOP")("vat")="show" Then
		Call pay.Vat("show")
	Else
		Call pay.Vat("hide")
	End If
	'Check if user is logged in
	pay.User_Logged(CInt(Session("User_ID")))
	
	'Check shop, category and product, then show the page!
	Call pay.ShopID(Cstr(ShopID))
	Call pay.ShopPass(Cstr(Password))

		If Request.Form("comments")<> "" Then pay.Save_Comment = Replace(Request.Form("comments"), "'", "''")
		If Request.Form("company")<> "" Then pay.Save_Company = Replace(Request.Form("company"), "'", "''")
		If Request.Form("name")<> "" Then pay.Save_Name = Replace(Request.Form("name"), "'", "''")
		If Request.Form("address1")<> "" Then pay.Save_Address1 = Replace(Request.Form("address1"), "'", "''")
		If Request.Form("address2")<> "" Then pay.Save_Address2 = Replace(Request.Form("address2"), "'", "''")
		If Request.Form("zip")<> "" Then pay.Save_Zip = Replace(Request.Form("zip"), "'", "''")
		If Request.Form("city")<> "" Then pay.Save_City = Replace(Request.Form("city"), "'", "''")
		If Request.Form("country")<> "" Then pay.Save_Country = Replace(Request.Form("country"), "'", "''")
		If Request.Form("state")<> "" Then pay.Save_State = Replace(Request.Form("state"), "'", "''")
		pay.Save_IP = Request.ServerVariables("REMOTE_HOST")
	
	sorder = pay.SaveCart(Request.Cookies("Shop")("User1"))
	If sorder= True Then
		Response.Write pay.Page()
	Else
		Response.Redirect "checkout.asp"
	End If
	
Set pay = Nothing
%>
137 ms totalt · 3 externa anrop · v20260731065814-full.0e50b1ef
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
133 ms — hämta tråd, inlägg och bilagor (db)