Windows Services + database read/write

Hello,
I'm writting a service using ATL SERVICE, it uses socket to comunicate
with other service running in a diferent PC. It works ok.
I need to read and write database(.mdb), I add ATL database "consumer"
class in the service. But it return error 0x800401F0 when I Open() it.

If I use the same come in application it works fine.
it is posible to read/write database from nt services? how can I do it?

Thanks,

0
8/2/2006 2:14:28 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
356 Views

Similar Articles

[PageSpeed] 22

Are you using a relative path to open the database?

When an application is running as a service the current working directory is
Windows\System32
Maybe you application can't find the database files.

If this is the case one fix would be to use a DSN.

AliR.

"GDiaz" <gabriela.diaz@gmail.com> wrote in message
news:1154528067.991260.154500@h48g2000cwc.googlegroups.com...
> Hello,
> I'm writting a service using ATL SERVICE, it uses socket to comunicate
> with other service running in a diferent PC. It works ok.
> I need to read and write database(.mdb), I add ATL database "consumer"
> class in the service. But it return error 0x800401F0 when I Open() it.
>
> If I use the same come in application it works fine.
> it is posible to read/write database from nt services? how can I do it?
>
> Thanks,
>


0
AliR3470 (3236)
8/2/2006 3:21:16 PM
thank you, I try it... but doesn't work.
I create a DSN in Control Panel, I try a User DSN and System DSN.
I copy mdb to windows\system32.... but nothing.


AliR ha escrito:

> Are you using a relative path to open the database?
>
> When an application is running as a service the current working directory is
> Windows\System32
> Maybe you application can't find the database files.
>
> If this is the case one fix would be to use a DSN.
>
> AliR.
>
> "GDiaz" <gabriela.diaz@gmail.com> wrote in message
> news:1154528067.991260.154500@h48g2000cwc.googlegroups.com...
> > Hello,
> > I'm writting a service using ATL SERVICE, it uses socket to comunicate
> > with other service running in a diferent PC. It works ok.
> > I need to read and write database(.mdb), I add ATL database "consumer"
> > class in the service. But it return error 0x800401F0 when I Open() it.
> >
> > If I use the same come in application it works fine.
> > it is posible to read/write database from nt services? how can I do it?
> >
> > Thanks,
> >

0
8/2/2006 4:05:49 PM
it could be possible that service has no permission to do it?
and it need some extra permission?
how can I set/change service permission?

GDiaz ha escrito:

> thank you, I try it... but doesn't work.
> I create a DSN in Control Panel, I try a User DSN and System DSN.
> I copy mdb to windows\system32.... but nothing.
>
>
> AliR ha escrito:
>
> > Are you using a relative path to open the database?
> >
> > When an application is running as a service the current working directory is
> > Windows\System32
> > Maybe you application can't find the database files.
> >
> > If this is the case one fix would be to use a DSN.
> >
> > AliR.
> >
> > "GDiaz" <gabriela.diaz@gmail.com> wrote in message
> > news:1154528067.991260.154500@h48g2000cwc.googlegroups.com...
> > > Hello,
> > > I'm writting a service using ATL SERVICE, it uses socket to comunicate
> > > with other service running in a diferent PC. It works ok.
> > > I need to read and write database(.mdb), I add ATL database "consumer"
> > > class in the service. But it return error 0x800401F0 when I Open() it.
> > >
> > > If I use the same come in application it works fine.
> > > it is posible to read/write database from nt services? how can I do it?
> > >
> > > Thanks,
> > >

0
8/2/2006 6:34:59 PM
Reply:

Similar Artilces:

Business Management Error Move CRM 4.0 Database to Different Machi
Hi, I have backed up a CRM 4.0 _MSCRM and MSCRM_Config database from one machine and restored both on another machine ( Which had been useing a test database). After restoring both databases on the new host I used the Deployment Manger to import the restored database. After completing the import when I attempt to open CRM I get an error message saying " Business Management Error The user ID associated the current record is not valid" From the server where I'm logged an as Administrator On client PC I get the following. Server Error in '/...

address database question
I am setting up an address database in Excel 2003 that I need to be able to use to make labels for mailings. I have people that are in different "categories" and will want to group them by that category, depending on who I am sending the mailing to. For instance, I have a person, Person A, who is a general supporter, lives in the area, and sponsors a child. Person A is in three of the possible 5 categories. Another person, Person B, might be simply a general supporter (i.e., in one category). How can I best organize the data - and the headings - so that I can make labels ...

deleted without being read
one of my users keeps getting a deleted without being read message from a message than had been created over a year ago. He is getting this message daily. Any idea how to stop that message from being created? Thanks. ...

Windows
Hi - hope someone can help I get the following message: exception processing message c00000013 75b6bf7c 4 75b6f7c 75b6bf7c This just started for no apparant reason. The message won't cancel, try again or continue. It returns after re boot. Compter still runs fine - just can't get rid of the message. Only recent program addition was Quicken 2010 - how ever this error message didn't happen immediately after it was loaded. I did find some threads on this but nothing there that seemed to directly address this issue. Running XP Home edition version 2002 Service Pac...

reading layout
Went from Wordperfect to Word this week, only thing I can't locate is the postion reading on the bottom of my screen to tell me where exactly I'm at in my document, been all over in tools and can't locate where to turn it on. Thanks Assuming this is Word 2007, right-click the status bar; on the context menu, you can choose exactly what you want displayed. -- Stefan Blom Microsoft Word MVP "Angie" <Angie@discussions.microsoft.com> wrote in message news:B84C2BAD-4594-46E7-BAF7-55632DB946F2@microsoft.com... > Went from Wordperfect to Word...

FWD: Use this patch for MS Windows
--qdllnovpufdcjy Content-Type: multipart/related; boundary="uxhdkqxammb"; type="multipart/alternative" --uxhdkqxammb Content-Type: multipart/alternative; boundary="rlpwnuaox" --rlpwnuaox Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Consumer this is the latest version of security update, the "October 2003, Cumulative Patch" update which eliminates all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express. Install now to continue keeping your computer secure from these vulner...

Sending shortcuts or hyperlinks to Windows XP users
I am on a shared network. When I send a shortcut or hyperlink to individuals on the network with Windows XP, it prompts them to save the file to disk with no option to open. Because this is a shortcut, I would like them to be able to click the shortcut and open the file. Does anyone know a way to do this for XP users? ...

Sales Payment Terms Entry Window security
In the Sales Transaction Entry Window (SOP) users can open the Sales Payment Terms Entry window by using the Terms Discount expansion icon. How does one prevent the users from accessing this window? This window name does not appear in the security setup. I suspect the window is really part of the Sales Transaction Entry window. My objective is to prevent users from entering data in this window. -- M Peterson Not sure what version you're using...but in my version 8.0 SP 3 this screen is called Sales Trade Discount Entry. If this is the screen you're after, you can set secu...

Linking Excel to a Access database #2
Thanks I am giving it a try, it retireves the data ok, but it i difficult to try and set the table up, there are too many differen categories in the data! I will try and see if I can work this one out though..... Otherwise is there anyway that Excel functions can count data in a Access database without importing it -- martin ridle ----------------------------------------------------------------------- martin ridley's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=803 View this thread: http://www.excelforum.com/showthread.php?threadid=26695 ...

Immediate window disappeared from the VBE
For some reason, the immediate window has gone from the VBE, instead there is a black space where it should be. View -> Immediate window doesn't do anything. Any idea? Thanks in advance Joseph Hi Joseph Try Control + G -- Regards Roger Govier "JOG" <philippeoget@hotmail.com> wrote in message news:50pf4gF1hdtcpU1@mid.individual.net... > For some reason, the immediate window has gone from the VBE, instead > there is a black space where it should be. > View -> Immediate window doesn't do anything. > > Any idea? > > Thanks in advan...

Chart should read as blank cell not as 0,it shows blank but reads
A B c 1 Project Start Date Jan-10 2 Project Duration 25 3 Project Cost 1000000 In B6 i wriiten formula IF(ROWS($1:2)-1>C$2,"",ROWS($1:2)-1) In D6 i written formula IF(B6="","",B6/$C$2) in E6 i writtend formula IF(D6<=33.33%,(($I$1*D6^2)*100),IF(D6<=66.67%,($I$2*D6+$I$3),IF(D6>=66.67%,($I$4+$I$5*D6+$I$6*...

Transfering Messages from Windows Live Mail to Outlook
I have a customer who is using Windows Live Mail (WLM). He has 142 441 files that take 13.3Gb. He keeps on loosing contacts everytime he quits WLM. In addition, He uses the signature feature to preprogram replies to his emails. With WLM when you reply, they all disappear and only the default signature remains. Finally, everytime he starts WLM, it is very slow because it scans his 142 441 files all the time. So I recommended to use Outlook. However, it is limited to 2Gb when we try to import data from WLM. Can you recommend a solution? -- Christopher Kozely EURL US Info In W...

Charts GONE after Windows XP SP3 Update!?!
I have Office 2007 SP1 Enterprise Edition and, until last night, Windows XP Professonal SP2 installed on my PC. Last night I went through the normal Microsoft Update site to upgrade to SP3 and everything seemed to go well. However, I noticed this morning that all of my Excel files I have that previously had worksheets on them showing charts are not displaying those charts at all. The worksheets that they were on are still in the files, but the charts themselves seem to have disappeared. Has this happened to anyone else and does anyone know of a way to resolve this? Thanks... Hi, ...

can't create a blank database
When I click on new blank database, it opens as an MDE with 5 hidden and uneditable tables locked in. They are as follows. MSysAccessStorage, MSysACEs, MSysObjects, MSysQueries, MSysRelationships. How do I open just a blank Access database application so I can add tables and create/delete and do everything until I am ready to make as an MDE? On Tue, 19 Feb 2008 08:57:03 -0800, JGAMBLER <JGAMBLER@discussions.microsoft.com> wrote: >When I click on new blank database, it opens as an MDE with 5 hidden and >uneditable tables locked in. They are as follows. MSysAccessStorage, &g...

How do i change 15 months to read 1 year and 3 months?
Can some one please provide a formula on how to change months into years and months? Example, I have 15 months in a cell, but would like the next cell to be read 1.3. meaning 1 year and 3 months. Thanks Marty With that format, how are you going to differentiate between 1 year and 1 month and 1 year and 10 months? The numbers 1.1 and 1.10 are indentical to Excel, so you can't accomplish the visual difference (1.1 vs 1.10) with formatting. =DOLLARFR(A1/12,12) will give you 1.01 and 1.10 for the above examples. You need to format the cell with 2 decimal places so you see 1.10, not just ...

Ability to enter multiple meter readings per day in field service.
Would like to have the abiltiy to enter multiple meter reading per day in fields service instead of being limited to just one entry per day. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-u...

Registry on windows 2008
Hi all, With Windows 2003, I'm using HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run to lunch process each time the user log in. I tryed to create the same key at the same place with Windows 2008 but it doesn't work. How can I do the same with Windows 2008 ? Does the Run Key still exist ? Thank you, Olivier On Mon, 19 Apr 2010 08:45:02 -0700, OlivierT <OlivierT@discussions.microsoft.com> wrote: >Hi all, > >With Windows 2003, I'm using >HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run to lunch >proces...

Security Access to a database
my partner and I are the administrators of our database when it was 2003. We brought the database into 2007 and everything seemed alright till we created a backend database and used the frontend to input data as we did with no problems in 2003. Now it won't let us access the database, back or front end. Is there a way to wipe out the security settings and start clean? Bernie, Access 2007 requires that the files be in a Trusted Location. Have a look at... http://www.regina-whipp.com/index_files/TrustedLocation.htm Oh, and you can't *wipe that out*. -- G...

Reading and writing UTF-8 files
I have to do some simple text editing to large-ish (2 Mbyte) html files generated by Word. They are, I believe, in UTF-8. It is the !%^&* problem where single apostrophes become sequences of funny characters, some spaces are shown as unprintable characters, etc. The following code just reads and writes a file, and shows the problem. It applies whether I use a String or a StringBuilder, and whether or not I explicitly force UTF-8 encoding. Can somebody just tell me basically how to copy an html file by reading it in and then writing it out, which is all the following meth...

MS CRM reading external database
Hi guys, If I have some transactional records sitting in an external database (outside of the MS CRM database), how can I: - create new fields in say, Opportunities, and have these fields read dynamically from this external database? - or alternatively, create a new table in the MS CRM database, have these new fields in Opportunities referenced/read from this new table? I can add new tables into the MS CRM database through Enterprise Manager, but Deployment Manager doesn't seem to be able to detect this new table. Urgently need input on this. Appreciate any reply at all! Thanks and ch...

exchange will not start, error directory service cannot start
after a power outage, my server would not boot. Found that three of the hard drives were offline, (raid 5 with five disks) Called dell, brought two back online and did a rebuild on the last one that was offline. They are all online but when I boot it up I get this error: Security accounts manager initialization failed because of the following error: Directory Service cannot start. Error status: 0xc00002e1. Please shutdown and reboot into Directory Services Restore Mode. I have been on hold with MS tech ....... -- Glenn MCP A+ Network Admin MBBC ...

Pasword protected Excel file encrypted, how do I read this file?
I password protected an important file. My husband downloaded the Office 2003 upgrade last night. Now when I try to access the file I get this message...This is an Excel file, I don't know why it looks encrypted or why I can't access it. This file is not in a recognizable format. If you know the file is from another program which is incompatible with Microsoft Office Excel, click Cancel, then open this file in its orginal application. If you want to open the file later in Microsoft office Excel, save it in a format that is compatible, such as text format. If you suspect the...

Service Appointment, Activity History, and "Due Date"
When I create a service appointment in CRM, and I check the "All Day Event" check box, the schedule start and end times disappear, and the dates sync. This seems logical. However, when I look in the activity tab or the history tab the "Due Date" displays the next day. For example, I create a service appointment where the scheduled start date is 2/10/2007, and I select the "All Day Event" checkbox. The scheduled end date is set to 2/10/2007, the duration is set to 1 day, and the time fields disappear. If I view this service appointment in the activities ...

Cant move my database :-(
When I move my ms access database to a new machine i get a message saying that the event proceedure on mousedown etc bla bla bla and the date fields do not populate. When I return to the pc i built the damn thing on it works like a dream! Anyone got any ideas? Cheers If you want help, you'd be best off saying exactly what "bla bla bla" is. It's like going to a mechanic and saying "my car did something: fix it". Is your application split into a front-end (containing the queries, forms, reports, macros and modules), linked to a back-end (containing the tables...

PostMessage and address of window
I want send RegisterWindowMessage from some thread to dialog class to listbox. I create this thread in dialog class so I use "this" to pass address window, but It doesn't work. Compilator doesn't show any error. But on the listbox the message which I send from thread doesn't appear there. Code: //dialog class: static UINT UWM_SEND_DATA = ::RegisterWindowMessage(_T("UWM_SEND_DATA"); SerialWriter* writer; //my thread in "SerialWriter" class writer = (SerialWriter *)AfxBeginThread(RUNTIME_CLASS(SerialWriter),THREAD_PRIORITY_NORMAL,0,CREATE_SUSP...