|
I agree with Eddy. You don't need to store the actual symbols in the database (although you can if it makes sense). The symbols are more a matter of UI.
I second using XML or similar to persist the concept of the expression.
|
|
|
|
|
I'm interacting with a dBase III file using Microsoft's ODBC dBase driver. I can create a CRecordset object and iterate through the table just fine (populating controls on a dialog and such). When I went to count the rows/records in the table using SELECT COUNT(*) FROM ACTY , the code kept throwing exceptions. Based on the error messages in the debug window, I suspected column 1 (type Date) was at fault. I managed to insert another column into the table of type Text (Numeric type also works). The COUNTing code now works fine. My question is, why? I could iterate the table just fine when the first column was a Date, but not count the rows. Is there a rule that states what types can be in the first column and what types cannot when counting? As there are hundreds of these database files in use, injecting a "dummy" column into them just for the sake of counting is not a solution.
[edit]
I was able to create a dBase 5 table and it exhibited the same behavior. When I added the extra column, however, no exceptions and counting worked fine.
[/edit]
[edit2]
I was able to successfully count records in the table using the ODBC API (e.g., SQLDriverConnect() , SQLExecDirect() , SQLGetData() ) rather than CDatabase and CRecordset .
[/edit2]
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
modified 19-Mar-12 10:45am.
|
|
|
|
|
I'm surprised at your findings. The COUNT function shouldn't care what columns are on the table or what datatype they're made of. May be a bug with the driver?
If I were you, I would suspected that USER was a keyword and would have tried to rename the table and see if it worked instead of adding a new column.
|
|
|
|
|
Shameel wrote: I'm surprised at your findings. The COUNT function shouldn't care what columns are on the table or what datatype they're made of. May be a bug with the driver?
I'm not familar enough with it one way or the other. If you step through the code, however, the columns are definitely being bound (in the set's DoFieldExchange() method).
Shameel wrote: If I were you, I would suspected that USER was a keyword and would have tried to rename the table and see if it worked instead of adding a new column. There are actually two tables: ACTY and USER. The USER table works fine with no changes, both iterating and counting.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
modified 18-Mar-12 16:58pm.
|
|
|
|
|
DavidCrow wrote: dBase III
I do hope that you have a copy of that database is a more recent format?
Bastard Programmer from Hell
|
|
|
|
|
If I can't operate on it directly, I will consider converting it. Given the constraints on the client side, that would be a last resort.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I suggest you use Microsoft Visual Foxpro ODBC Driver[^]. It has full compatility with other xBase product (including dBase III+), it is newer, and it has much better handling with SQL queries.
hth,
foxyland
|
|
|
|
|
I'm working on a WPF app that has user profiles. The profile contains the user's picture. Any reason not to store the image in the Profiles table?
Never done this before. Suggestions/comments appreciated.
Thanks
Everything makes sense in someone's mind
|
|
|
|
|
Kevin Marois wrote: Any reason not to store the image in the Profiles table?
I don't have any; that's what I'd do. If you're not already, you may want to resize the images to some standard before doing so.
|
|
|
|
|
Ok, thanks
Everything makes sense in someone's mind
|
|
|
|
|
If you were working on a webapp, then it'd be sweeter to have them on the server directly so that the browser can cache them.
Outside of that environment, I prefer to store those things in the database. That way you can backup all the data that belongs together in a single document.
Bastard Programmer from Hell
|
|
|
|
|
Actually, I'm working on an app thay will have WPF, WinPhone, and Web UI's, so maybe storing them on the server is best.
Everything makes sense in someone's mind
|
|
|
|
|
The problem I have with that is if someone replaces a file with one you don't expect.
|
|
|
|
|
PIEBALDconsult wrote: The problem I have with that is if someone replaces a file with one you don't expect.
What does that have to do with how they are stored?
|
|
|
|
|
The file system is less secure.
|
|
|
|
|
PIEBALDconsult wrote: The file system is less secure.
I doubt that is relevant in a system that needs to be secure.
If one does nothing but assume that a database is "more" secure than a file system with no other concern for security then they will have problems. And one a real security policy in place any real differences in implementation of systems at this level becomes much less significant allowing one the freedom to base decisions on other business needs.
|
|
|
|
|
I'll stick with the more secure solution regardless. It's like putting things in a bank vault rather than relying solely on the security guard at the door.
|
|
|
|
|
PIEBALDconsult wrote:
I'll stick with the more secure solution
regardless. It's like putting things in a bank vault rather than relying solely
on the security guard at the door.
Not at all. At least not at most banks, because your analogy is not a complete statement of the security policy in place at the bank.
For instance...how is the vault secure if the door to it is left open, the front door to the bank is left open and there is no active security monitoring system in place?
And note that several years ago one large study found that 90% of security problems with actual losses originated internally within the company.
|
|
|
|
|
jschell wrote: originated internally within the company.
Which is my point too. Generally, more people have access to the file system than to the database. A no-longer-gruntled sys admin could replace individual files, but not alter the contents of the database.
|
|
|
|
|
Kevin Marois wrote: Actually, I'm working on an app thay will have WPF, WinPhone, and Web UI's, so maybe storing them on the server is best.
I'd still store them in a database
You'll want a specific folder to store the user-pictures; you don't want to store them between "all other" pics like logo's and the like. This gives also the advantage that you can delete everything in this path and rebuild it with the info from the database, without touching other graphics.
Bastard Programmer from Hell
|
|
|
|
|
For small images database is probably best, simply because it is going to be easier to implement.
|
|
|
|
|
This may or may not be the right forum to ask this type of question. I haven't hung out in this database area to know. Please, let me know where to post this. I can add more detail if contacted.
I'm looking for a professional mysql database developer to perform a job/service for me. I have very little database experience and need either a consultant/expert type or someone who can answer questions (justify reasons and choices made) and design and develop a mysql database. I am a software developer and realize that I am out of my league in order to build a database (and PHP website) to handle potentially rapid growth so I am also interested in how things should be done and why.
|
|
|
|
|
Yup, you're right; this is not the right place to ask this. Trouble is, I'm not sure where the right place since the job board seems to have gone. Maybe the collaboration forum?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Thanks, for the suggestion...I was not confident about posting it in the collaborative area however I did a search on the google and found a neat website called elance. It looks like its setup for what I want to do. I haven't researched it too much so at first glance, though it may be unfair, I'm a little wary about what kind of talent pool is there, and I'm wondering if I could pay by the project based on an initial estimate or bid versus an hourly rate.
If anyone knows any pros or cons to sites like that one, please let me know.
TIA
|
|
|
|
|
JohnnyG wrote: a mysql database
JohnnyG wrote: to handle potentially rapid growth
I recommend SQL Server (Express).
|
|
|
|