|
you know that may be what i want to do, but i can not find any documentation on it. what does that function actually do?
and what does it required to be passed?
thanks
|
|
|
|
|
Is this a SQL database? If so, it has built-in stored procedures for just this sort of thing, and more.
|
|
|
|
|
it is a access database being accessed through odbc.
|
|
|
|
|
I'm not as experienced with Access, but I do not know of it having anything internally that will pack a database. If that is indeed the case, you will need to do it manually. Something like:
open database in exclusive mode
create a temporary database
for each row that is not marked for deletion, copy it to temporary database
close the temporary database
close the main database
delete the main database
rename the temporary database
This is a very high-level overview but hopefully you get the idea. You might also want to look at the Compact utility. It works in basically the same way I described above, but no doubt more elegantly!
|
|
|
|
|
that is what i was originally thinking. but that again is what i was hoping to avoid. when you get to large files this function becomes slow.
thank you.
|
|
|
|
|
First of all I am not sure what you mean by marked for deletion? Is there a field in the table that marks the recordset for deletion? If not, then you should check the batch mode.
If there is a field in the table that flags the record as deleted then you should check SetFilter or set_filter functions. This way only the records that need to be deleted will be accessed (you can specify your own filter criterias). If your database allows you to delete multiple records at once then you can go ahead and do that. If not, then you should iterate through each element and delete them.
How are you accessing the database? ODBC, ADO, etc.?
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
I'm writing a very simple console program to solve a very specific problem i'm having:
I have two computers set up in a home network configuration. One is newer and one is older. I have my printer plugged into the older one (becuase of space). However, if the older comp is not on and I run Word i get this error (that references the printer driver) that crashes word. I've called customer support for the printer and the vendor but they are clueless (go figure). So I've decided to write a simple fix for this prob. However, I haven't written code in a year (no so much a prob) and there are some things i've never had to do in a prog that i'm going to have to do for this:
-start a process (the printer software) from within my prog...I'm probably going to use CreateProcess()
-end a process from within my prog
-to check and see if a process is running (the printer software)...wishful thinking tells me someone has a function that does this and will simply return a bool value
-to check if the other computer is connected to the network...I figured the easiest way to do this would be to ping the other computer and use the ping as the deciding factor, but how do you get a ping from within your own prog?
Any help on this would definently be great.
Thanks
PS I'm going to hide the prog using parameters from CreateProcess() because creating a service would be too much of a hassle.
|
|
|
|
|
What operating systems are you using? What kind of printer are you using? What version of word?
:wq! wrote:
ping the other computer and use the ping as the deciding factor, but how do you get a ping from within your own prog?
Yes this is probably the best way. I think there are a few examples that put a GUI on ping on this site.
I was thinking why not get a 1 port network printserver connect that to the printer and leave it on all the time. I have used them in the past. You should be able to buy one for less than $50 on ebay.
John
|
|
|
|
|
I'm writing the code in WinME (ick) and putting it on a WinXP box. This is kind of why I want to keep the program really simple.
|
|
|
|
|
I fogot: the printer is an hp 5550...HP technical support just told me that is was a Word prob and told me to call the vendor.
|
|
|
|
|
The reason why I asked these questions is that I have never experienced this myself and I have (as a system admin) seen many different printer configurations. I don't see why the printer driver would cause an application to crash but a badly written driver could.
John
|
|
|
|
|
me neither...
I've tried upgrading the driver and reinstalling word a couple of time to no avail. Besides why would Word be in communication with the printer while i'm typing?
|
|
|
|
|
Hi everyone!
I wonder how to associate my own extension to the program that I build.
For example I have saved a file as MyFile.ext. When I double-click the file in explorer I want to start my program and load the file. I do not use serialization.
The program is written in VC++6.0.
I appreciate any help
kratesis
|
|
|
|
|
When you create a new SDI or MDI application with AppWizard, it creates a .REG file that will register your app's extension.
|
|
|
|
|
I am creating several windows using the Create function within Visual C++(MFC), i plot a graph on one of the windows and need it to be updated regularly, as I am implementing a tooltip feature where the mouse can be moved over a point and then the value of that point is displayed. The problem i am having is refreshing the view when another value is displayed, as it keeps displaying the previous values on top of the graph which also means the graph cannot be viewed easily. Any ideas on solving this problem, I tried using Invalidate and UpdateWindow with no luck
Rishi
|
|
|
|
|
see:
http://www.codeproject.com/script/comments/forums.asp?msg=550923&forumid=1647#xx550923xx
and
http://www.codeproject.com/script/comments/forums.asp?msg=549039&forumid=1647#xx549039xx
now my test result is :
the clean app works, but the clean DLL does not.
a good man
|
|
|
|
|
Hi friends,
anybody knows how to Hide a file or folder programatically? I meant, I need to lock that file/folder with password and invisible also.Even if the windows explorer properties set to show hidden items.
Vikram
|
|
|
|
|
vikrams wrote:
I need to lock that file/folder with password
This (i.e., setting permissions) can only be done with an NTFS volume.
vikrams wrote:
...invisible also.Even if the windows explorer properties set to show hidden items.
Wouldn't this kind of defeat the purpose of Explorer being able to show hidden files? There is no super-hidden attribute.
|
|
|
|
|
Hi.
I was wondering if anyone ever wrote a class that handled a CSV-file.
All data is seperated with a comma.
A single line can look like this:
"1234", "MyName", "MyFirstName", "1970-02-15"
The class needs to parse this data. For example checking what the type of data is. (first numeric, 2&3th text, 4th: VALID date (year-mm-dd))
Date needs to be validated too ofcourse.
Anyone can help?
Greetings
Jens
|
|
|
|
|
I have been reading in a file using the getline function and using a (,) as a delimiter.
I made a string caled name.
string name;
Then I do a getline(fin, name, ',');
I need to put the names in a char array. I thought I was doing that until I needed to use the names and I was getting garbage instead of the names I thought I was putting in the char array.
I was doing this to add them to the array which gives me junk.
Names[i] = stdup(name.c_str())
How can I read in a list of names 3 - 8 characters long and store them in a char arrray?
I can't have an array of strings because of other constraints.
Thanks,
Steven
|
|
|
|
|
Where's the CString problem here?
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
If you can be sure that you have enough space in your Names[i] field, then do
strcpy(Names[i], name.c_str()); instead of
Names[i] = strdup(name.c_str()); I seem to remember that your Names definition was an array of char s, in which case this would work.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
I seem to remember that your Names definition was an array of chars, in which case this would work.
Hmmm, I think it was an array of 45 char pointers, which made little sense since (!) the numeric members of that structure were NOT arrays.
Edit: Looks like we were both right. In one post he had
struct TSimHeader
{
char Name[45];
...
}
and in another he had
struct TSimHeader
{
char *Name[45];
...
}
|
|
|
|
|
You have a good memoy,
But if you rememeber, I have to actually put the chars in the array and not just the pointers because the array is getting sent to another PC. The recieving PC would have no use for the pointers on my machine.
here is my structure.
struct TSimSignal<br />
{<br />
int SimWriteFlag;<br />
int DisplayReadFlag;<br />
double Value[45]; <br />
double TimeStamp;<br />
<br />
}static TSimSignal_arr[1];<br />
<br />
<br />
struct TSimHeader<br />
{<br />
char Name[45];<br />
char Unit[45];<br />
double Min[45]; <br />
double Max[45]; <br />
int SignalCount; <br />
int SimStatus;<br />
<br />
}static TSimHeader_arr[1];
Once again back to putting junk in the char arrays (Name and Unit)
thanks,
steven
|
|
|
|
|
TSimHeader header;
strcpy(header.Name, name.c_str()); Should do the trick. If you're sending an array of TSimHeader 's then you'll have something like this:
TSimHeader headers[10];
strcpy(header[0].Name, name.c_str()); Similarly for other members of the array.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|