26. november 2008 - 23:00Der er
44 kommentarer og 1 løsning
Fra Excel til MS Sql
Hej jeg prøver at gøre sådan så hvis der ligger en excel fil i en mappe på serveren, kan den hente data fra excel filen og ligge ned i Ms sql databasen.
Jeg har prøvet at læse mig lidt frem til det, men der står alt muligt om en ADO eller Oledb. Men jeg ved ikke hvad jeg skal bruge det til. Jeg håber der er nogle herinde som kan hjælpe mig?
Jeg ved godt hvordan man normalt forbinder til en Sql database og indsætter data og trækker ud. Men ikke fra en excel fil.
Så jeg vil være meget taknæmmelig hvis der er nogle som kan hjælpe mig med det.
This is taken from that link. Follow the instruction, and hopefully it will work. If not we'll take it from there.
NOTE: This resolution uses a SQL Server OLE Provider DLL (Sqloledb.dll) as an example. Because the unregistered DLL may vary based on the OLE DB Provider that you are using, modify step 2 accordingly.
To resolve this problem, reregister the faulty DLL as follows: At a command prompt, change to the C:\Program Files\Common Files\System\Ole DB folder. At a command prompt, type the following command: regsvr32 sqloledb.dll You should receive confirmation that the DLL is registered successfully.
When I type: "regsvr32 sqloledb.dll" into the command prompt a windows error box appears and says: LoadLibrary("sqloledb.dll")mislykkedes - Det angivne modul blev ikke fundet
I tried both ways, but I don't know why it says that?
sqloledb.dll is normally included with MDAC (Microsoft Data Access Components) which is normally included with Windows Xp and also SQL Server, so I find it strang ethat it isnt included on your PC. Anyway you should try downloading MDAC and installing it, but first it might be an idea to check the version you have insatlled, if any.
Hi Adam After you have downloaded the file (cc_pkg.exe) you have to double click on it to install the files to your PC and run the program.
Then you can do one of three things as described in the link given earlier.
1: Perform an analysis of your machine and automatically determine the release version. 2: Perform an analysis against a selected version. 3: Scan the machine. Don't perform an analysis.
So if you start with the first you will see which version you have on your PC. You will also see a summery report with a list of all the files included in the MDAC version you have. Normally you should have an MDAC version which includes the file you are missing (sqloledb.dll) and I'm sure this check will also confirm that the MDAC version you have is either installed incorrectly or is a version which doesnt included the file.
So if you can start with th efirst selection (Perform an analysis of your machine ...) then we can take it from there.
When I have downloadet it and try to install it. A popup comes up and says: MDAC 2.8 RTM er ikke kompatibel med denne version af Windows. Alle funktionerne er i øjeblikket en del af Windows
as you can see from this link http://support.microsoft.com/kb/899861 it looks as though MDAC 2.81 are included with Windows XP SP2 and installing 2.8 will fail.
If you reda this you can see where the handler.reg file is.
>>> c. When prompted for the file handler.reg, either point to C:\Program Files\Common Files\System\msadc, or put the Windows XP CD in your CD-ROM drive.
Not sure why it needs msado27.tlb, I would have thought it was 28 it wanted. If you have followed the instructions for repairing correctly then I'm out of ideas.
ok, now it continued copying some files. But when i press on the "MDAC_TYP.EXE" now it still pops up and says: "This setup does not suport installing on this operating system."
If you are still out of ideas with this, do you then know if maybe there are other ways to copy data from excel to ms sql database? that was how it all started. :-D
Don't I have to press on the file that I downloaded before I tried to repair, to install it? And how can I check if the repair is complete and it is successful? Would it just work now, to import excel to sql?
I have sql server 2005.
But I also have something called sql server 2008, but that is just with a configuration tool, that I can't use I think.
But the program I've been using is called visual webdeveloper 2008 express edition. So I have just been using the program's sql server. Until it is going on the net.
I can open the component checker and then I run the first option: 1: Perform an analysis of your machine and automatically determine the release version.
Then some files come, and there is also a file called: sqloledb.dll
could I use that for something. Or could you please explain how I can check if my MDAC is working?
Hi again, now I actually maybe think the mistake is corrected, because before this line: @"Provider=Microsoft.Jet.OLEDB.4.0; was in 2 lines so I moved it up so it would be in one line, but now a new error came. I don't know if it meens the same, or how to fix this one. Now it says: Den installerbare ISAM kan ikke findes.
In the first link there are a number of methods to import Excel into SQL Server.
I would have tried using DTS (SQL 2000) or Microsoft SQL Server 2005 Integration Services (SSIS) myself and I'm not sure if mdac is needed to do this,but thats easy enough to find out (try) :o)
"Now I actually tried downloading mdac 2.7 service pack 1"
And now I'm lost! 2.81 is included with Windows XP SP2 so I wouldnt have thought that you would be allowed to install 2.7.
I think it would be best for you to search on Google. If you try in English I think you have a better chance of finding something.
Try search on Google with
installable ISAM cannot be found XP
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.