Click here to Skip to main content
15,889,365 members
Home / Discussions / C#
   

C#

 
AnswerRe: File Not Found Exception Handling Pin
0x3c028-Feb-09 23:16
0x3c028-Feb-09 23:16 
GeneralRe: File Not Found Exception Handling Pin
Lim Yuxuan1-Mar-09 1:27
Lim Yuxuan1-Mar-09 1:27 
Questionbuilding network in form of a graph Pin
sunnyk8628-Feb-09 20:52
sunnyk8628-Feb-09 20:52 
AnswerRe: building network in form of a graph Pin
Yusuf28-Feb-09 21:16
Yusuf28-Feb-09 21:16 
AnswerRe: building network in form of a graph Pin
Eytukan1-Mar-09 2:41
Eytukan1-Mar-09 2:41 
Questiontoolbar moving Pin
shefa' isied28-Feb-09 20:42
shefa' isied28-Feb-09 20:42 
AnswerRe: toolbar moving Pin
Yusuf28-Feb-09 21:17
Yusuf28-Feb-09 21:17 
QuestionSocket Pin
mrithula828-Feb-09 20:39
mrithula828-Feb-09 20:39 
AnswerRe: Socket Pin
Yusuf28-Feb-09 21:22
Yusuf28-Feb-09 21:22 
GeneralRe: Socket Pin
mrithula828-Feb-09 22:47
mrithula828-Feb-09 22:47 
GeneralRe: Socket Pin
0x3c028-Feb-09 23:23
0x3c028-Feb-09 23:23 
GeneralRe: Socket Pin
mrithula828-Feb-09 23:39
mrithula828-Feb-09 23:39 
GeneralRe: Socket Pin
0x3c028-Feb-09 23:54
0x3c028-Feb-09 23:54 
GeneralRe: Socket Pin
mrithula81-Mar-09 17:22
mrithula81-Mar-09 17:22 
GeneralRe: Socket Pin
mrithula81-Mar-09 18:48
mrithula81-Mar-09 18:48 
QuestionHow to Copy Form in Project ? Pin
E_Gold28-Feb-09 20:12
E_Gold28-Feb-09 20:12 
AnswerRe: How to Copy Form in Project ? Pin
Yusuf28-Feb-09 21:26
Yusuf28-Feb-09 21:26 
GeneralRe: How to Copy Form in Project ? Pin
E_Gold28-Feb-09 22:13
E_Gold28-Feb-09 22:13 
GeneralRe: How to Copy Form in Project ? Pin
Yusuf1-Mar-09 3:28
Yusuf1-Mar-09 3:28 
AnswerRe: How to Copy Form in Project ? Pin
Henry Minute1-Mar-09 1:51
Henry Minute1-Mar-09 1:51 
QuestionAccess Database crashing on load in Vista Pin
Hitchic0528-Feb-09 17:22
Hitchic0528-Feb-09 17:22 
I've got a program I've written that uses an Access Database for a backend. I've been using it on XP for awhile now with no issues. However recently I've got a new user who has Vista 64 bit. My application crashes before it even finishes loading. Using some debug code in a custom compile I did for him I've narrowed it down to the following section of code:

string sAppPath = (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)).Replace("file:\\", "");
public System.Data.OleDb.OleDbConnection DBConnection = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + (sAppPath + "\\Database.mdb"));

sSQLStatement = ("SELECT Filename FROM Scriptures");
System.Data.OleDb.OleDbCommand SQLCommand = new System.Data.OleDb.OleDbCommand(sSQLStatement, DBConnection);

try
{
    if (DBConnection.State.ToString() == "Closed") DBConnection.Open();

    // Create the datareader object to connect to table
    System.Data.OleDb.OleDbDataReader DataReader = SQLCommand.ExecuteReader();

    // Did we get anything?
    while (DataReader.Read())
    {
        // Do some manipulation
    }

    // Close the reader 
    DataReader.Close();

    // Close the connection. Its important.
    DBConnection.Close();
}


The program crashes on this line:

if (DBConnection.State.ToString() == "Closed") DBConnection.Open();


I'm at a loss as to why this would work on XP but not Vista. I don't have a Vista machine readily available for testing at this time.

Any help would be greatly appreciated. Thanks!
AnswerRe: Access Database crashing on load in Vista [modified] Pin
Douglas Troy1-Mar-09 7:18
Douglas Troy1-Mar-09 7:18 
AnswerRe: Access Database crashing on load in Vista Pin
Razvan Dimescu1-Mar-09 22:42
Razvan Dimescu1-Mar-09 22:42 
GeneralRe: Access Database crashing on load in Vista Pin
Douglas Troy2-Mar-09 7:18
Douglas Troy2-Mar-09 7:18 
QuestionMonitor and scan internet files Pin
Ghaith Hachem28-Feb-09 12:09
Ghaith Hachem28-Feb-09 12:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.