Showing posts with label foxpro. Show all posts
Showing posts with label foxpro. Show all posts

Tuesday, March 27, 2012

DTS question

Ok, i have a set of foxpro tables and a SQL 2000 db.

i'm trying to move a table of data from the fox to the sql2000.

I'm using dts to point a connection to a particular table in fox, and setting the destination to my sql database.

i select 'create table' and it makes the table in sql for me.

i click on the transformations tab, and it sets up the transforms. no problem.

when i execute, i'm getting these generic errors ('cannot convert data type') or some such bs. the error does not tell me WHAT TRANSFORMATION or what source field is causing the problem.

so i manually went and eliminated each dts transform (one at a time) and ran till i found the offending dts transform.

so i figured this one out.

here's my question:

WHAT A PAIN IN THE BUTT! what can i do to get dts to tell me what friggin transform is the offending transform?

I've got several HUNDRED tables to convert yet, and if i have to do this again i'm going to jump off a tall building.

there's got to be a better way...When we moved our data from Visual FoxPro into SQL Server we used the Upsize Wizard from within Visual FoxPro. It was pretty painless (although I believe we had to add all of the free tables to a database). Would this work for you?

Terri

Sunday, March 11, 2012

DTS Package Fails after 1000 Rows......

I am having a DTS package which copies data from Foxpro DBF to Sql Server. This DTS package is called in a VB program and Global Variables for DTS is set inside the VB program based on which DTS package copies the Data.

The problem which i am facing is, after 1000 rows transferred using DTS package, DTS package fails and starts giving Errors.

Inside the VB program i have ensured that the DTS package is released properly.

Please help me out, need a solution to this very badly......

Thanks

Pranjal Sharma

This may be an extreme but may be relative. Blank records or special characters being filtered through VB can cause a halt in the transfer.

If it errors after exactly 1000 records every time, I'd look at the content of that record specifically. If it errors after approximately 1000 records, it maybe timing out.

Adamus

|||Posting the error message will help...

DTS Package Fails after 1000 Rows......

I am having a DTS package which copies data from Foxpro DBF to Sql Server. This DTS package is called in a VB program and Global Variables for DTS is set inside the VB program based on which DTS package copies the Data.

The problem which i am facing is, after 1000 rows transferred using DTS package, DTS package fails and starts giving Errors.

Inside the VB program i have ensured that the DTS package is released properly.

Please help me out, need a solution to this very badly......

Thanks

Pranjal Sharma

This may be an extreme but may be relative. Blank records or special characters being filtered through VB can cause a halt in the transfer.

If it errors after exactly 1000 records every time, I'd look at the content of that record specifically. If it errors after approximately 1000 records, it maybe timing out.

Adamus

|||Posting the error message will help...

Friday, February 17, 2012

DTS import works directly, fails when scheduled

I'm new to DTS packages, but managed to create one that successfully empties a table in SQL Server then imports data from a Foxpro file on another server into it. It runs fine if I execute it from DTS, but fails if I schedule it to run in SQL Server Agent (using the "Schedule Package" option in DTS). I think the relevant portion of the error returned when the job fails is:

Error string: [Microsoft][ODBC Visual FoxPro Driver]File 'hrpersnl.dbf' does not exist.

The file does exist. I also tried to execute it from a stored procedure, but got a similar error. Any thoughts on why it runs one way but not the other?

TIAI'm new to DTS packages, but managed to create one that successfully empties a table in SQL Server then imports data from a Foxpro file on another server into it.

TIA
Where do u kept the dbf file? Are u sure the connections are ok? I feel when the scheduling task is taking place your other server is some what down.That may be a cause.Plz check that ...|||When you run a DTS package directly (from the console), the job runs under whatever login/authorization that you use to connect to the SQL Server. This is typically your Windows login.

When you schedule a DTS package to run as a SQL Agent Job, you can choose what credentials the job will use by default (i.e. the job owner), and also for each job step (on the step's "Advanced" tab, near the Ok button). The default is almost never your own Windows Login.

The difference in the credentials used often leads to problems with permissions.

-PatP|||rudra: I had already checked that. The server/file are there.

Pat: I was not thinking a permissions problem, because the job does start. It completes the first step of emptying the table, then errors trying to find the dbf file. Since that's found through ODBC, my assumption is that it wouldn't matter how the DTS package is run.

In Enterprise Manager, I can execute the package in the DTS section and it will run fine. If I execute the job from SQL Server Agent, it fails with that error about the dbf file.|||Just to humor me, could you change the job owner to be whatever your credentials are when you run the job manually, just to see what happens?

-PatP|||I apologize Pat, I wasn't trying to imply you were wrong. You know a lot more about this than I do. I'm probably not understanding exactly where you're talking about. Maybe it's a Friday afternoon brain cramp. Here's a picture of where I'm looking:|||Sorry, you're looking in the DTS designer. I meant to find the job, which is what actually is scheduled and change the job's owner to be you (in other words, the job and the DTS package that it uses will then run as though you had started it manually).

-PatP|||Changing the job owner will not change the outcome.

Are you using UNC to point to the file location or through a mapped drive?|||I've gotta say, I'm feeling pretty dense right now. On the General tab of the Job's properties in SQL Server Agent (still in Enterprise Manager), the owner was listed as:

DomainName\Administrator

which is how I'm logged into the server. I tried sa, and it still doesn't work. I appreciate your persistence, and by now you must be thinking "how stupid is this guy?".

rdjabarov: I'm using a mapped drive, which is the only way I've ever been able to get the FoxPro ODBC to work.|||Very good call rdjabarov! I hadn't considered the use of a mapped drive, since I can't remember the last time I used one for a scheduled task.

The problem comes from the fact that the SQL Server Agent actually starts as a service before the Windows Explorer does. The mapped drive exists as a side effect of the Windows Explorer, so the mapped drive letter is usable by any process running as a result of user action (such as launching a DTS package), but the mapped drive is not available to a process started by SQL Agent.

In order to access the DBF file, it must exist in a place that the SQL Agent process can find it. The obvious choice would be to find a way for the DTS process to connect the ODBC driver via a UNC to the DBF file. The next would be to copy the DBF file to the machine running the DTS package so it can use a local drive (say via a command process).

It is usually easy to make the ODBC connection to the DBF file, but there can be complications. You'll need to make sure that the job step that accesses the DBF file on the remote machine runs as a Windows Login that has access to the UNC.

-PatP|||I think you've nailed it. I created a quick test, and it worked. I'll try it on the real package on Monday.

Thank you both very much!

:beer:|||I did a little testing yesterday and then let the scheduled job run overnight last night. It ran fine, and I can run the package from a stored procedure now, which I couldn't do before.

Thank you both very much for your time and expertise.|||I think you've nailed it. I created a quick test, and it worked. I'll try it on the real package on Monday.Ok, just being dreadfully curious at this point since you're already happy, but what exactly did you try, and how did that work in production?

-PatP|||Not sure what you're after in addition to post 12. I was able to create an ODBC connection with a UNC path. I did some testing with a test package on a test database Friday, and it worked. I modified the connection in the production package to use the new DSN. I let the scheduled job run last night, and it was successful. I was also able to execute the package from a stored procedure, which had failed before (same error).|||That's exactly what I was looking for...

I had presumed that you were using a UNC from the beginning, so I never thought to question that. I thought the problem you were having was due to the job starting as either a SQL login or a Windows login that didn't have permission to read from that UNC.

What I wanted (and you gave in post 14) was an explanation of what actually worked for you.

Thanks!

-PatP|||It's funny, because I almost always use UNC paths. For some reason years ago when we bought this program (a canned Payroll/HR package), the vendor set everything up with mapped drives and we stayed with it ("if it aint broke, don't fix it" type thinking).

I link to their data all the time, but when this problem cropped up, I couldn't figure out why it would work one way and not the other. Your explanation in post 10 was pure gold, and I understand now. It's nice to know the "why" in addition to the "what".

Big thanks to you and rdjabarov for digging me out of the hole!

DTS Import to SQL Server 2000 from Visual FoxPro

Greetings,

I am unsure if this is the correct forum to send this question, but I can't seem to find any information regarding this problem. If this is the wrong place, please direct me to the correct spot.

I am attempting to import data from a free tables FoxPro database to SQL 2000 using a DTS Package which has worked correctly every day for the past 2 years. Yesterday, I got an error.

The package has around 10 tables that it deletes, re-creates, and populates with data from the Foxpro. All of the tables except one work correctly.

When I try to do an explicit import using the ODBC connection to populate that one table, I get the following error: Context: Error calling Openrowset on the provider.

I created an access database on my local computer and setup an ODBC connection and link tables to the database to see if it would work, and it did. So I thought there might be something wrong with the ODBC data source on the SQL Server, so I deleted it and created a new one, used it and I receive the same error.

I thank you in advance for any assistance or direction you can provide me for finding an answer.

Let's see if we can narrow this down. If you use another client besides your DTS package on the same machine to access that ODBC DSN, does it work? If not, this problem is likely outside of DTS. If you create a new DTS package to get to that table, does it work? If so, then you should compare the settings of the old and new package.|||

After poking around some more last night, I found extremely low disk space on the system partition.

Once I cleared some space, it works fine.

For some reason, the person before me formatted this box with only a 5gb system partition.

Luckily, this server is due for replacement soon.

Thank you for taking the time to try and help Ted.

|||

Hi Clipper,

I see you've solved your problem. Did you know there is an OLE DB data provider for FoxPro? It works with all versions of Fox tables and is downloadable from http://msdn2.microsoft.com/en-us/vfoxpro/bb190232.aspx .