Click to See Complete Forum and Search --> : help on deploying project


jayson_13
August 16th, 2002, 06:59 AM
guys, i really needs ur helps help
i have a project which i have successfully create an installer and deployed it on other machine.
when i running the program on other machine it gives me error...
i have oledy installed .netframework, oledb provider and configured the ODBC data source.

sample program:
'on button1_click
dim conn as adodb.connection
dim rs as adodb.recordset
conn = new adodb.connection
rs = new adodb.recordset
conn.open(provider = "XXXXXXXXXXXXXXXXXXXXXXXXX")
sql = "select aaa from jobrecord"
rs = conn.execute (sql)
msgbos rs.fields("aaa").value

i'm using ado.net and making it as windows application..
is this causing me error????
thank you!!!!

Akim
August 16th, 2002, 08:56 AM
What kind of error are you getting?

jayson_13
August 16th, 2002, 09:03 AM
catastrophic failure when i run on XP machine.
unspecified error when i run on win 98 machine

jayson_13
August 16th, 2002, 09:10 AM
i'm using MySQL server.. i have installed MyODBC 3.51 on the target machine and configured the ODBC.. the target machine can connect to my DB server but the program can't..

Akim
August 16th, 2002, 09:15 AM
Do you have any error handling in your application?

Akim
August 16th, 2002, 09:19 AM
The only thing I can think of is a conflict between Providers on your development computer and on your target computer.
Or, incorrectly configured ODBC.

jayson_13
August 16th, 2002, 09:23 AM
my error handler gave me the msg i have posted just now..
ODBC on target comp works perfect cos i have tested..
provider supports both XP and win98 machine..
and my development computer is running perfectly on XP machine..

Akim
August 16th, 2002, 09:30 AM
Well, I understand that your errorhandler gives that error, but where does the error occur?
on conn.open?
on rs = conn.execute (sql)?

Try to localize the error.

jayson_13
August 16th, 2002, 09:37 AM
tat is true.. but i still not familiar with the debug tools in .net.
the onli thing i can do is like tat..

on error goto errHandler
conn.open(XXXX)
rs = conn.execute(sql)
....
.....

so i can't locate where the error occur..

Akim
August 16th, 2002, 09:50 AM
Try
conn.open(XXXX)
Catch
messagebox.Show ("Error in conn.open(XXXX)")
End Try

Try
rs = conn.execute(sql)
Catch
messagebox.Show ("Error in rs = conn.execute(sql)")
End Try

It's very simple and much better then "on error goto errHandler
" (personal opinion).

From .NET help:

Try...Catch...Finally StatementsSee Also
End Statement | Err Object | Exit Statement | On Error Statement | Exception Class
Provides a way to handle some or all possible errors that may occur in a given block of code, while still running code.

Try
[ tryStatements ]
[ Catch [ exception [ As type ] ] [ When expression ]
[ catchStatements ] ]
[ Exit Try ]
...
[ Finally
[ finallyStatements ] ]
End Try
Parts
tryStatements
Optional. Statement(s) where an error can occur. Can be a compound statement.
Catch
Optional. Multiple Catch blocks permitted. If an exception occurs while processing the Try block, each Catch statement is examined in textual order to determine if it handles the exception. Exception represents the exception that has been thrown.
exception
Optional. Any variable name. The initial value of exception is the value of the thrown error. Used with Catch to specify the error caught.
type
Optional. Specifies the type of class filter. If the value of exception is of the type specified by type or of a derived type, the identifier becomes bound to the exception object.
When
Optional. A Catch statement with a When clause will only catch exceptions when expression evaluates to True. A When clause is only applied after checking the type of the exception, and expression may refer to the identifier representing the exception.
expression
Optional. Must be implicitly convertible to Boolean. Any expression that describes a generic filter. Typically used to filter by error number. Used with When keyword to specify circumstances under which the error is caught.
catchStatements
Optional. Statement(s) to handle errors occurring in the associated Try block. Can be a compound statement.
Exit Try
Optional. Keyword that breaks out of the Try…Catch…Finally structure. Execution resumes with the code immediately following the End Try statement. Not allowed in Finally blocks.
Finally
Optional. A Finally block is always executed when execution leaves any part of the Try statement.
finallyStatements
Optional. Statement(s) that are executed after all other error processing has occurred.
End Try
Terminates the Try...Catch...Finally structure.
Remarks
If errors occur that the programmer has not handled, Visual Studio for Applications simply provides its normal error message to a user, as if there was no error handling.

The Try block contains code where an error can occur, while the Catch block contains code to handle any error that does occur. If an error occurs in the Try block, program control is passed to the appropriate Catch statement for disposition. The exception argument is an instance of the Exception class or an instance of a class that derives from the Exception class corresponding to the error that occurred in the Try block. The Exception class instance contains information about the error including, among other things, its number and message.

Note If a Try statement does not contain at least one Catch block it must contain a Finally block.
Example
The following simplified example illustrates the structure of the Try…Catch…Finally statement:

Public Sub TryExample()
Dim x As Integer = 5 ' Declare variables.
Dim y As Integer = 0
Try ' Set up structured error handling.
x /= y ' Cause a "Divide by Zero" error.
Catch ex As Exception When y = 0 ' Catch the error.
MsgBox(ex.toString) ' Show friendly error message.
Finally
Beep() ' Beep after error processing.
End Try
End Sub
See Also
End Statement | Err Object | Exit Statement | On Error Statement | Exception Class



--------------------------------------------------------------------------------

Send feedback to Microsoft

© 2001 Microsoft Corporation. All rights reserved.

jayson_13
August 16th, 2002, 09:29 PM
provider gave me error.
but how come my development comp works?
I'm using the same provider and configured the ODBC perfectly..