Thanks for all the replies and suggestions. as it stands the table structure does reveal different AccountNames when queried on different columns (AccountID, CustomerID). And yes, that seems redundant because for case of one record having unique set of AccountID, CustomerID, and AccountName it is obvious. For case of many records with mixed combinations of those 3 columns, I am not guaranteed the AccountName is what I want. I think I'm only concerned if AccountName is not NULL. Thanks!
john john mackey
Posts
-
subquery using 1 table -
subquery using 1 tableI think i need the construct i initially posed, but there may be the case where the result may return more than one result - in which case i could handle with MAX() or a simple aggregate. When i first call tblAccountInfo with AccountID, it gives me 1 record in tblAccountInfo with a CustomerID. When i call tblAccountInfo using CustomerID, it will return AccountName, different than if I used AccountID, but I need both calls to retrieve different sets of data from same table. I need first call to tblAccountInfo to get the CustomerID to use in the second call. :sigh:
-
subquery using 1 tablei'm not sure if this is a Circular Reference problem or not. i have the following SQL query
SELECT tb1.SomeField,
(SELECT tb2.AccountName
FROM tblAccountInfo tb2
WHERE tb2.CustomerID = tb1.CustomerID) AS strAccountName
FROM tblAccountInfo tb1
WHERE tb1.AccountID = 123456Since i'm using the same table in the subquery, is this a problem? If it is a circular problem, how could i correct this? Thanks, JJ
-
Problem with qsort() on CArray(ptr *, ptr *)Thanks! the first link you provided as a reference looks exactly like the setup i am using. I also updated my post under one of the first replys - the < and > brackets may have corrupted my original question. JJM
-
Problem with qsort() on CArray(ptr *, ptr *)Sorry, i think the brackets watered down my description. I have declared a CArray as:
CArray<CmyData *, CmyData *> myDataArray;
I fill myDataArray correctly using CArray::SetAtGrow(). This is done correctly because I test by iterating through the CArray after i fill it and check all the items in the CmyData object. Then i attempt:
CmyData** pData = (CmyData **) myDataArray.GetData();
// verified both myDataArray and pData can report back my data - iterated thruqsort(pData, numItems, sizeof(CmyData *), Compare);
Then when i look in my Compare() function, the 2 parameters have invalid values. I don't know if there is a problem passing pData like i do OR if my Compare() function is not resolving the 2 parameters correctly. (PS, thanks for the other posts on articles to read..)
-
Problem with qsort() on CArray(ptr *, ptr *)can someone help me? I have a variable declared as CArray<CmyData *, CmyData*> myDataArray; then I try the following:
CmyData** pData = (CmyData **) myDataArray.GetData();
qsort(pData, numItems, sizeof(CmyData *), Compare);Something is whacky with how Compare() function receives the information from pData. Pointers go off to neverland?? Thank you. RESOLVED: My Compare function had to be adjust to handle array of pointers:
myClass::Compare(const void* pEle1, const void* pEle2)
{
CmyData* pData1 = *(CmyData **) pEle1;
CmyData* pData2 = *(CmyData **) pEle2;
// do the comparison, now that the defrenced pointer good}
-
Tabs/Property Page etiquetteawk! I saw the Microsoft site, but aren't these the same people who created the horrible interfaces that are cited in the "How not to create an interface" links found on the Net? Yes, the MS site had some good suggestions. Thank you. JohnJohn
-
Connectivity Options - selecting datasources on the flyI currently have an application that connects to a local Access 2007 database. The application itself is written within Access (VBA) and uses DAO connectivity. I connect to the data source and work with linked tables (queries done in similar manner) so that the user interface and VBA code is separate from the data to promote sw maintainability. What is now desired is the ability for my user to quickly change between data sources. That is, the user can browse his local machine, select an .ACCDB file, and then change his data source for my app - not exiting out of the app. I currently have a kludgy way to do this (still all in DAO) that requires exiting out of the application for the change to take effect. Would an ODBC configuration provide an easier solution? In ODBC, you establish the connectivity ahead of time, BUT you have the ability to change the Database (data source) under User DSN, Configure, Select Database. FURTHERMORE, the data may migrate to a server-based repository (SQL Server, Oracle, etc...) This may/WILL dictate me switching to ADO. Any suggestion on how to simplify the selecting of databases? Thank you.
-
Tabs/Property Page etiquetteWe know that many things in code are possible, but that doesn't mean you have to code something horrendous. To me, having an option on a property page control the "spawning" of additional property pages (Tabs) is just rediculous (what makes it worse is that it creates an error when repeated or simply trying to use.) Are there some good design resources or user interface style practices (on the Net or book form) that I can share with my clueless collegue? Much thanks before I explode in anger. JJM
-
Manual edits then upload to SharePoint serverI am using SharePoint Designer 2007 and InfoPath 2007 to make some modifications to forms I maintain. As a new developer to InfoPath and SharePoint, i want to know how I can publish (upload) some changes i did to the .XSL files. Rather than use InfoPath and go 1-by-1 to create ToolTip text to all my buttons (a hundred or so), i "Saved As" my SharePoint files and then found where in .XSL files to change. NOW, i want to publish those changed .XSL files. How can i do this? Thank you so much. JJM
-
SQL Server and C#Thank you for your comment and some topics to investigate regarding ADO.net. Yes, the learning curve and porting our existing system is an important consider for staying with C++. - John John
-
SQL Server and C#Thanks for the insight. Now I must look at the differences/advantages of ADO.net v ADO. Regards, John John
-
SQL Server and C#Currently, i am using C++ with ADO commands. My programming team maintains several thousand lines of code in C++ (Visual Studio 2008) and there are roughly 1K-3K lines that interact with external databases in the Microsoft SQL Server environment. The majority of the system(s) code we maintain don't perform SQL Server interaction - maybe 25% will interact with SQL Server. Maybe i'm missing the difference between ADO and ADO.net. Also, back to the original question, what do i gain if i choose C# over C++ ? Most of the team knows C++/MFC and we are clueless on C#. Thanks.
-
SQL Server and C#there is debate in my local office as whether or not we would benefit from migrating from C++ to C# to work with our SQL Server database. currently we are using MS SQL Server Express R2 as a test model and making connections and doing some stored procedure work from C++ front end. Eventually, we will work in our customer's environment of the full fledged Microsoft SQL Server. Can I get some feedback/opinions on the pros and cons of each - C++ and C# ? Thank you, JJ Mackey
-
Recordset Seek - multiple fieldsif I use the Seek method with multiple criteria, does Seek use any of the fields to match or all fields must match? I have an ADODB Recordset. My syntax follows:
Dim cnn As ADODB.Connection
Dim rst As ADODB.RecordSet'set connection (assume correct)
Set cnn = CurrentProject.Connection
Set rst = New ADODB.Recordset
rst.Open "MyTable", cnn, adOpenKeyset, adLockOptimistic, adCmdTableDirect'rst.index = "PrimaryKey"
'check if recordset valid - if rst.RecordCount >0rst.Seek fld_cmpr1 & fld_cmpr2 & fld_cmpr3, adSeekFirstEQ
Does this mean ALL 3 fields must match otherwise Seek result in rst.EOF?? (likewise, if this were DAO and i used rstDAO.Seek "=", fld_cmpr1..... do ALL fields must match?) Thanks! JJM
-
parsing .frm file for control names and nested levelTrue that, and that's basically why i want to achieve what I'm asking... I have some legacy application and there are some 3rd party controls that have long since been retired. I want a method to identify all the controls in my application and determine what needs attention. My take on this would be to write my own simple parser to:
1. search .FRM for "Begin" 2. for each "Begin", push onto a stack (var name, unique id, level++)
3. for each "End", pop from stack, print info (id++, level--, var name)(you can see my c++ tendencies) It seemed quicker to ask the community before setting off and writing. Cheers.
-
parsing .frm file for control names and nested levelHi, i searched around the Net and Code Project for some existing parser, but so far unsuccessful. What I want to do is parse a Visual Basic .FRM (form) file and extract the control names defined within. I also want to determine if there are nested controls within. If possible, convert the listing and nested information into some format that can be easily worked with by other tools - like XML or some identifiable tree structure. For example (MyForm.frm):
Begin Control1Lib.Cntrl1 MyCntrl1
Height = 555
Left = 0
...
Begin Control2Lib.Cntrl2 MyNestedCntrl2
Height = 375
...
BeginProperty Font {aldfladlf-lsl-ladsjlfj}
...
EndProperty
End
EndThen the parser could tell me I have two controls (MyCntrl1, MyNestedCntrl2) and SHOW that MyNestedCntrl2 is nested inside MyCntrl1.
Examples:
Level ControlName
1.0 MyCntrl1
1.1 MyNestedCntrl2
2.0 MyCntrl2
2.1 Nested2_1
2.2 Nested2_2
3.0 MyCntrl3
3.1 Nested3_1
3.1.1 Nested3_1_1
3.1.1.1 Nested3_1_1_1
...XML example:
I am sure this is somewhere out on the Net where I can download, so can you point me to the place to research? Thank you much! JJ
-
Field ordering in a tableis there an advantage to laying out fields of certain data types in a particular order? For example, in MS Access 2007, is it best to have all Memo fields at the end of the table definition? Thanks, JJ
-
how to align logos/watermarks on formI am creating a main menu form in Access 2007. I want to use 3 graphics as logos on this form. I want one to be aligned to upper-left (it is horizontally extended with stripes to stretch across). I also want 2 other graphics to be aligned in the upper-RIGHT of my form (two graphics that occupy equally square areas). I am making this main menu form to FILL the area of Access, so when I resize the Access window's containing frame, the logos will adjust accordingly. Is this possible? How can i do this (Use the Header area? Use the form's Picture property? Unbound object? Depth, Z-order?) Thank you. JJM
-
Variants of SQL ServerCool! Thanks. I was thrown some loose requirements and some info on past configuration (maybe misquoted the past configuration, server/service,....) I am installing this on a Windows Server 2008 R2 64-bit system. Eventually, i'm going to be adding some features to integrate MS Access 2007, Visual C++ (Studio 2008 Ed) code, some stored procedures (which i think are created/reside in my C++ generated executable), PowerShell. Thanks all for the input and advice. Regards, John John