codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Problem with Calling Com Object  yhng81 at 09:39 on Friday, March 12, 2004
 

hi, i'm a newbie in programming. i have problem with calling my Com Object from my asp.net page.Can anyone tell m wat's this error going 2 tell:

Object variable or With block variable not set.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:
System.NullReferenceException: Object variable or With block variable not set.

and my codes is goes up like this : -

<%@ Page ASPCompat="True" %>
<script runat="server">
Dim ObjTx
Dim Cn
Dim ObjNewMember
Dim RsDefault,TravellerType,DefTesting

Sub Page_Load
Cn = Server.CreateObject("ADODB.Connection")
Cn = "DRIVER={SQL Server};SERVER=(local);UID=sa;PWD=;DATABASE=pubs"

ObjNewMember = Server.CreateObject("Hotel.NewMember")
ObjNewMember.CnStr = Cn

RsDefault = Server.CreateObject("ADODB.Recordset")
RsDefault.Open ("Select * from Defaults", Cn)
if not RsDefault.EOF then
TravellerType = RsDefault("DefaultTraveller").Value
end if

Session("STravellerType") = TravellerType
RsDefault.Close()

End Sub
</script>
<form runat=server>
<table>
<tr>
<td>
<% Dim DefTravellerType
DefTravellerType = Session("STravellerType")
%>
<%
ObjTx.ComboTravellerType (CInt(DefTravellerType), "Name='cmbTravellerType' Size='1' Class='dropdown'", "")
%>
</td>
</tr>
</table>
</form>

is that any wrong wif my asp.net code or com object? hopefully can hear fr ur guys soon n solve the problem 4 me..thanx ..








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: onload event
•  Active Widgets
•  Re: onmouseover change image and text
•  Line Printer Interface
•  import contacts of msn/yahoo
•  Call windows apps from web apps
•  Re: ASP.NET web controls
•  netscape 6 browser problem
•  Re: Print .doc file from the website using System.Diagnostics.Process


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005