Results 1 to 3 of 3
  1. #1
    skifreak is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    6

    Cant load all data

    I have 2 versions of this application:
    OLD:
    Access 97 and VB6 - no issues

    NEW:
    Access 2010 and .net framework 4.0 C#

    I can load the same data with no issues in the old version

    When I open the new version, it dies before it completes. "Cannot open any more databases"

    It is 1 db and 1 table I am using

    Here is my code. I am trying to load a tree view:



    Conf Billing
    Date
    Requestor
    Client

    It could have more than 1 date and clients.

    Here is my code:

    Code:
    try
    Code:
    {
    conn = newOleDbConnection(strCONNECTION);
    conn.Open();
    string strSQL1 = @"SELECT DISTINCT([Date Request Received]) FROM BILLING ORDER BY [Date Request Received] DESC";
    OleDbCommand cmd1 = newOleDbCommand(strSQL1);
    cmd1.Connection = conn;
    cmd1.CommandType =CommandType.Text;
    OleDbDataReader reader1 = cmd1.ExecuteReader();
    //add date
    while (reader1.Read())
    {
    dateNode = newTreeNode(reader1["Date Request Received"].ToString().Substring(0, 10), 1, 1);
    rootNode.Nodes.Add(dateNode);
    //add requestor(s)
    string strSQL2 = @"SELECT DISTINCT(Requestor) FROM BILLING WHERE [Date Request Received] = #" + dateNode.Text + "#";
    OleDbCommand cmd2 = newOleDbCommand(strSQL2);
    cmd2.Connection = conn;
    cmd2.CommandType = CommandType.Text;
    OleDbDataReader reader2 = cmd2.ExecuteReader();
    while (reader2.Read())
    {
    requestorNode = newTreeNode(reader2["Requestor"].ToString(), 4, 4);
    dateNode.Nodes.Add(requestorNode);
    //add client(s)
    string strSQL3 = @"SELECT Client, [Internal Record ID] FROM BILLING WHERE REQUESTOR = '" + requestorNode.Text + "' AND [DATE REQUEST RECEIVED] = #" + dateNode.Text + "#";
    OleDbCommand cmd3 = newOleDbCommand(strSQL3);
    cmd3.Connection = conn;
    cmd3.CommandType = CommandType.Text;
     
    OleDbDataReader reader3 = null;
    reader3 = cmd3.ExecuteReader();
    while (reader3.Read())
    {
    requestorNode.Nodes.Add(reader3["Internal Record ID"].ToString(), reader3["Client"].ToString(), 2, 2);
    } 
    }
    }
    }
    catch (Exception ex)
    {
    MessageBox.Show("Error in Loading all: " + ex.Message);
    }
    finally
    {
    conn.Close();
    }
    

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    I assume that this is C# code; at any rate it isn't Access VBA code. I suspect that you'd do better to post this in a C# forum.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    skifreak is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    6
    Quote Originally Posted by Missinglinq View Post
    I assume that this is C# code; at any rate it isn't Access VBA code. I suspect that you'd do better to post this in a C# forum.

    Linq ;0)>
    It appears to be an Access issue not C# which is why I posted it here. If I was allowed to do it in T-SQL, I wouldn't have an issue.

    The same query it fails on while running works fine when I paste it directly into Access.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Load csv data to Oracle through Access
    By acces2oracle in forum Access
    Replies: 1
    Last Post: 10-24-2011, 02:41 PM
  2. load csv data into linked table
    By acces2oracle in forum Programming
    Replies: 2
    Last Post: 09-12-2011, 04:47 AM
  3. Report data load time
    By GraemeG in forum Reports
    Replies: 0
    Last Post: 06-05-2011, 05:52 AM
  4. Program to load data
    By fsmikwen in forum Access
    Replies: 2
    Last Post: 12-10-2009, 08:36 AM
  5. Find data, load data, and save as a new record
    By hawzmolly in forum Access
    Replies: 0
    Last Post: 10-05-2008, 03:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums