Click here to Skip to main content
15,880,503 members
Home / Discussions / C#
   

C#

 
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 
AnswerRe: Monitor and scan internet files Pin
abdul jalil1-Mar-09 3:48
abdul jalil1-Mar-09 3:48 
GeneralRe: Monitor and scan internet files Pin
Ghaith Hachem1-Mar-09 4:04
Ghaith Hachem1-Mar-09 4:04 
QuestionReading specif Excel sheet headers Pin
alvas8928-Feb-09 11:09
alvas8928-Feb-09 11:09 
AnswerRe: Reading specif Excel sheet headers Pin
Calin Tatar28-Feb-09 16:12
Calin Tatar28-Feb-09 16:12 
GeneralRe: Reading specif Excel sheet headers Pin
alvas893-Mar-09 9:08
alvas893-Mar-09 9:08 
AnswerRe: Reading specif Excel sheet headers Pin
0x3c01-Mar-09 0:03
0x3c01-Mar-09 0:03 
GeneralRe: Reading specif Excel sheet headers Pin
alvas893-Mar-09 9:12
alvas893-Mar-09 9:12 
QuestionCD Image in C# [modified] Pin
Demasoni28-Feb-09 9:54
Demasoni28-Feb-09 9:54 
AnswerRe: CD Image in C# Pin
harold aptroot28-Feb-09 10:41
harold aptroot28-Feb-09 10:41 
AnswerRe: CD Image in C# Pin
Henry Minute1-Mar-09 2:01
Henry Minute1-Mar-09 2:01 
QuestionTo display Node atrributes such that node name is added to tree? Pin
rasingh128-Feb-09 8:23
rasingh128-Feb-09 8:23 
Questionwindows version check Pin
shabya28-Feb-09 7:26
shabya28-Feb-09 7:26 
AnswerRe: windows version check Pin
harold aptroot28-Feb-09 7:30
harold aptroot28-Feb-09 7:30 

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.