|
I managed to figure out why, my next question is, why is my code not returning the IP and saying the site site is in active, and also when it returns an IP I type that IP in the browser and it doesn't take me to the domain that its assigned to. why? I guess I could see this as a security prevention but how do I get the right IP from it?
|
|
|
|
|
All of this comes down to a screwed up DNS system. None of this is because of your code.
If you give the DNS system host name and it returns the wrong IP, unless you're the administrator of the DNS system, there's nothing you can do about it.
Either the correct IP is returned, or some proxy server for the browser to use is returned, or the data doesn't go to the correct machine.
The other thing is that Ping is NOT a viable method for determining if a host is available or not. This is because firewalls may be between you and the host, blocking ICMP traffic or the host may be ignoring all ICMP traffic, even though the server and its web site are up and running and responding.
|
|
|
|
|
Knowing I dont have the admin access what would be the viable method without seeming I am a threat to any system. If ICMP isnt going to work then how else would I go about converting the hostname into an IP using the best methods?
|
|
|
|
|
Without a known good authoritative DNS that knows about the target system you have no options. The only thing you need the DNS for is to resolve the hostname to an IP or the other way around. If you don't have a good DNS, you have no hope of matching up hostnames to IPs.
ICMP is the protocol that Ping uses, not DNS. Ping sends an ICMP packet to the hostname or IP specified and waits for a response. If it gets one within the timeout period, the host is considered alive by Ping.
If not, this is in no way an indication that the host is unavailable or down. It just means the packet either never got to the host because of a firewall blocking it (getting more and more common) or it's passing through some hop that filters out ICMP.
Internally, Ping uses DNS to resolve a specified hostname to an IP. You can only talk to IP addresses, not hostnames. If DNS is wrong or not working properly, the Ping will be wrong too.
|
|
|
|
|
Perhaps a far-fetched alternative, but at least it's another option;
You could setup OpenDNS[^] on a remote machine, and have that convert the IP to a host-name (using a webservice or whatever type of communication). You'd call the <a href="http://msdn.microsoft.com/en-us/library/sbetxfzt.aspx">Dns.GetHostByAddress</a>[<a href="http://msdn.microsoft.com/en-us/library/sbetxfzt.aspx" target="_blank" title="New Window">^</a>] -member, and return the host-name.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hello. I have this small COM component which I added to my project using 'Add Reference'. Now when I tried to generate delegates from this component, I get this error.
<br />
An error occured creating the form. The error is: Public member 'FunctionName()' on type 'MyComponentName' not found <br />
Here is what I am trying
public sub Constructor()
private objName as New Component()
objName.OnFunctionCall = new COM_Component_OnFunctionCallEventHandler(AddressOf OnFunctionCall)
end sub
public sub OnFunctionCall()
end sub
What could be wrong? Thanks for any input.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
public sub Constructor()
Dim objName as New Component()
objName.OnFunctionCall = new COM_Component_OnFunctionCallEventHandler(AddressOf OnFunctionCall) // delegate
end sub
public sub OnFunctionCall() // my delegate
MsgBox "Test"
end sub
The Private keyword is used if you declare your variable outside of a method, inside the method you'd typically use the Dim keyword.
In VB, you use the '-character to denote a comment, // are for C# and will not work in VB. See the difference with the syntax-highlighting above.
Naming the method 'Constructor' doesn't make it one. Use the VB-syntax if you need an actual constructor. It's something like 'Sub New' or similar.
For your question; it would seem that the class 'MyComponentName' does not have a method with specified signature. You are instantiating something else than MyComponentName ; you created a new Component[^], and that's an existing animal that does not have a OnFunctionCall member.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi. Thanks for the reply. I am still stuck on it. What is the difference between the method shown previously and the method I am trying below
Public Class ABC
Private objName as New Component()
Public Sub New()
AddHandler objName.OnFunctionCall, AddressOf OnFunctionCall
End Sub
Public Overridable Sub OnFunctionCall()
MessageBox.Show("asd")
End Sub
End Class
However it is giving me this exception
<br />
An unhandled exception of type 'system.stackoverflowexception' occured in 'mscorlib.dll'<br />
What could be wrong with my understanding till now?
This world is going to explode due to international politics, SOON.
|
|
|
|
|
AmbiguousName wrote: What is the difference between the method shown previously and the method I am trying below
Most major difference is that objName is now a class member, no longer a variable within the constructor. Also changed, you now have the correct constructor.
The Component is an EXISTING control, one that gets not instantiated because it's one of the base-controls; also, note it does not have a member called "OnFunctionCall".
I'm going to guess that you'd want to instantiate your own class. For that, you'd have to define it first, something like this;
Public Class MyThingy
End Class
Public Class ABC
Private Thingy as New MyThingy()
Public Sub New()
AddHandler objName.OnFunctionCall, AddressOf OnFunctionCall
End Sub
Public Overridable Sub OnFunctionCall()
MessageBox.Show("asd")
End Sub
End Class
"OnFunctionCall" does not exist in the Thingy-class here, but it looks like that's what you'd want. Or is there a special reason for using "Component"?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: "OnFunctionCall" does not exist in the Thingy-class here, but it looks like that's what you'd want.
Yes.
- But first I want OnFunctionCall() to be triggered in class ABC, which happens to be a virtual function also.
- Same function will be called in MyThingy since MyThingy a child class of ABC.
Eddy Vluggen wrote: Or is there a special reason for using "Component"?
Just learning it.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
This would be inheritance;
Public Class MyThingy : Inherits ABC
Public Overrides Sub OnFunctionCall()
MsgBox "Hello Universe!!"
End Sub
End Class
Public Class ABC
Public Sub New()
End Sub
Public Overridable Sub OnFunctionCall()
MessageBox.Show("Hello world!")
End Sub
End Class
Which is different from embedding a class;
Public Class MyThingy
Public Event EventHandler OnMyFunction
Private Sub TriggerEvent()
OnMyFunction(Me, EventArgs.Empty)
End Sub
End Class
Public Class ABC
Private Thingy as MyThingy()
Public Sub New()
Thingy = New MyThingy
AddHandler Thingy.OnMyFunction, AddressOf LocalOnMyFunctionImplementation
End Sub
Public Overridable Sub LocalOnMyFunctionImplementation(Object as Sender, e As EventArgs)
MessageBox.Show("asd")
End Sub
End Class
AmbiguousName wrote: Just learning it.
Enjoy
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Dear all,
The following script is not reading the xml data and translating it into the graph.
The output is currently showing a blank webpage, and I am not sure why is?
<BODY>
<%
Dim oRs, oRs2, strQuery
Dim strXML
Set oRs = Server.CreateObject("ADODB.Recordset")
strXML = "<graph caption='Deals Output report' subCaption='By Quantity' decimalPrecision='0' showNames='1' numberSuffix=' Units' pieSliceDepth='30' formatNumberScale='0'>"
strQuery = "select * from deal_price2"
Set oRs = oConnection.Execute(strQuery)
While Not oRs.Eof
Set oRs2 = Server.CreateObject("ADODB.Recordset")
strQuery = "select sum(price) as TotOutput from deal_price where deal_id=" & ors("deal_id")
Set oRs2 = oConnection.Execute(strQuery)
strXML = strXML & "<set name='" & ors("date") & "' value='" & ors2("TotOutput") & "' />"
Set oRs2 = Nothing
oRs.MoveNext
Wend
strXML = strXML & "</chart>"
Response.Buffer=true
response.write strXML
response.flush
Set oRs = nothing
Call renderChart("MyWeb/includes/FCF_Line.swf", "", strXML, "FactorySum", 650, 450)
%>
Any help would be very much appreciated.
Thanks in advance for your help.
|
|
|
|
|
Your first tag is <graph>, but you end with </chart>
|
|
|
|
|
thank you for your response and I am still getting a blank page, however this is transparent image on the page.
The page shows no error on the page but webpage is output is blank with no graph.
Any help is really much appreciated.
Thank you for your time and help.
|
|
|
|
|
Do a "View source" on the resulting page as see what you DO get.
|
|
|
|
|
Chances are really god that you're going to have to ask your question here[^] because you're trying to use a 3rd party library. The odds of someone here who has used this thing and wandering by your question are slim. If you've got questions about a library, you go to a forum dedicated to that library for the best chance of getting your questions answered.
|
|
|
|
|
Thank you for your response and help.
I very much appreciate your time.
Thank you.
|
|
|
|
|
First of all I want to apologize in advance if this is the wrong section to post this. I was looking for VBScript section and I wasn't able to find one. I have a Database (Access) and I'm trying to insert information in it. I keep getting the following error:
Microsoft JET Database Engine error '80040e07'
Data type mismatch in criteria expression.
/ordersconnection3.asp, line 33
There are around 19 fields. Some are defined as text, number, currency, date/time. How do I define the variables datatype in VBscrpit. On Visual Basic it was as easy as Dim X As Double. From what I've researched As in Dim is not allowed.
|
|
|
|
|
According to this[^], you can't.
This[^] indicates a cause may be the permissions on the folder.
This is all the help I can give you, unless you post some of the script that is giving the error.
I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image.
Stephen Hawking
|
|
|
|
|
<%
Dim Employee_ID, Customer_ID, Shipper_ID, Tax_Rate, Tax_Status, Status_ID
Dim Order_Date, Shipped_Date, Paid_Date
Dim Ship_Name, Ship_Address, Ship_city, Ship_State_Province, Ship_Zip_Postal_Code, Ship_Country_Region, Payment_Type, Notes
Dim Shipping_Fee, Taxes
Employee_ID=Request.Form("Employee_ID")
Customer_ID=Request.Form("Customer_ID")
Order_Date=Request.Form("Order_Date")
Shipped_Date=Request.Form("Shipped_Date")
Shipper_ID=Request.Form("Shipper_ID")
Ship_Name=Request.Form("Ship_Name")
Ship_Address=Request.Form("Ship_Address")
Ship_City=Request.Form("Ship_City")
Ship_State_Province=Request.Form("Ship_State_Province")
Ship_Zip_Postal_Code=Request.Form("Ship_Zip_Postal_Code")
Ship_Country_Region=Request.Form("Ship_Country_Region")
Shipping_Fee=Request.Form("Shipping_Fee")
Taxes=Request.Form("Taxes")
Payment_Type=Request.Form("Payment_Type")
Paid_Date=Request.Form("#Paid_Date#")
Notes=Request.Form("Notes")
Tax_Rate=Request.Form("Tax_Rate")
Tax_Status=Request.Form("Tax_Status")
Status_ID=Request.Form("Status_ID")
sSQL = "INSERT INTO Orders (Employee_ID, Customer_ID, Order_Date, Shipped_Date, Shipper_ID, Ship_Name, Ship_Address,
Ship_City, Ship_State_Province, Ship_Zip_Postal_Code, Ship_Country_Region, Shipping_Fee, Taxes, Payment_Type, Paid_Date,
Notes, Tax_Rate, Tax_Status, Status_ID) Values ('" & Employee_ID & "', '" & Customer_ID & "','" & Order_Date & "', '" &
Shipped_Date & "', '" & Shipper_ID & "', '" & Ship_Name & "', '" & Ship_Address & "','" & Ship_City & "', '" &
Ship_State_Province & "', '" & Ship_Zip_Postal_Code & "', '" & Ship_Country_Region & "', '" & Shipping_Fee & "','" & Taxes
& "', '" & Payment_Type & "', '" & Paid_Date & "', '" & Notes & "', '" & Tax_Rate & "', '" & Tax_Status & "', '" &
Status_ID & "')"
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("/database/Examen.mdb")
Set connection = Server.CreateObject("ADODB.Connection")
connection.Open(sConnString)
connection.execute(sSQL)
response.write "The form information was inserted successfully."
connection.Close
Set connection = Nothing
%>
I'm assuming that the problem lies withing the values part of the Insert into.
|
|
|
|
|
Take your single quotes out from around values that are supposed to be numeric
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
So leave dates as they are and only take the single quotes and leave ampersands? I tried taking the single quotes for numeric values and now I'm getting a syntax error.
|
|
|
|
|
AFAIK, in Access database SQL strings, dates are delimited by #. No delimiters for numbers and single quotes for strings.
HTH
|
|
|
|
|
Thank you for taking your time and helping me out. I did over 12 hours of "Research" on this last night and I couldn't get a straight answer from the internet. I'm still getting a data type mismatch when I input all the information.
I noticed I have two fields that I have never worked before. In access I have 2 fields that read memo as type and 2 that are in the currency format. Would I follow '" "' for memos and " " for currency or do they have a determined way to input data. Visual Studio debugger keeps telling me there's a problem with this certain line: connection.execute(sSQL).
My code reads as follows:
Employee_ID=Request.Form("Employee_ID")'Number *field in access*
Customer_ID=Request.Form("Customer_ID")'Number
Order_Date=Request.Form("Order_Date")'Date/Time
Shipped_Date=Request.Form("Shipped_Date")'Date/Time
Shipper_ID=Request.Form("Shipper_ID")'Number
Ship_Name=Request.Form("Ship_Name")'Text
Ship_Address=Request.Form("Ship_Address")'Memo
Ship_City=Request.Form("Ship_City")'Text
Ship_State_Province=Request.Form("Ship_State_Province")'Text
Ship_Zip_Postal_Code=Request.Form("Ship_Zip_Postal_Code")'Text
Ship_Country_Region=Request.Form("Ship_Country_Region")'Text
Shipping_Fee=Request.Form("Shipping_Fee")'Currency
Taxes=Request.Form("Taxes")'Currency
Payment_Type=Request.Form("Payment_Type")'Text
Paid_Date=Request.Form("Paid_Date")'Date/Time
Notes=Request.Form("Notes")'Memo
Tax_Rate=Request.Form("Tax_Rate")'Number
Tax_Status=Request.Form("Tax_Status")'Number
Status_ID=Request.Form("Status_ID")'Number
sSQL = "INSERT INTO Orders (Employee_ID, Customer_ID, Order_Date, Shipped_Date, Shipper_ID, Ship_Name, Ship_Address, Ship_City, Ship_State_Province, Ship_Zip_Postal_Code, Ship_Country_Region, Shipping_Fee, Taxes, Payment_Type, Paid_Date, Notes, Tax_Rate, Tax_Status, Status_ID) Values (" & Employee_ID & ", " & Customer_ID & ", #" & Order_Date & "#, #" & Shipped_Date & "#, " & Shipper_ID & ", '" & Ship_Name & "', '" & Ship_Address & "','" & Ship_City & "', '" & Ship_State_Province & "', '" & Ship_Zip_Postal_Code & "', '" & Ship_Country_Region & "', " & Shipping_Fee & ", " & Taxes & ", '" & Payment_Type & "', #" & Paid_Date & "#, '" & Notes & "', " & Tax_Rate & ", " & Tax_Status & ", " & Status_ID & ")"
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("/database/Examen.mdb")
Set connection = Server.CreateObject("ADODB.Connection")
connection.Open(sConnString)
connection.execute(sSQL)
response.write "The form information was inserted successfully."
connection.Close
Set connection = Nothing
%>
I don't expect for anyone to solve the problem for me, I'm just simply not experienced enough with html and asp vbscript quoting to figure this out on my own as I've been working on this all weekend long since Thursday and I've gotten nowhere. I've created around 7 connections and once I get this going, I feel confident enough that the others will work.
|
|
|
|
|
Memo fields are string types, and currency are number types - so follow the same format as those types when creating your string.
The best way to check if your SQL string works is to place a debug output after the string is created, copy that string over to the MS Access query builder and run it there. That should give you better insight on what the problem could be.
HTH
|
|
|
|
|