473,683 Members | 2,793 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Linked server and text file...

2 New Member
Hi i am trying to use text file to write a value as soon as there is any update/insert into a table.
for that i am using a text file and made a linked server relation with it.....
and inserting into the needed value in the text file usind linked server insert command.....

Till here its working fine....
now with time the text file is growing and i only needed the latest value from the text file.....
so i want to truncate the values from table.....
whenever i am truncating or deleting i am getting the error..


I'll explain what i did....

1. create folder [C:\testSQLEvent]
2. create file Sample.ini
3. copy the follwing content
ColNameHeader = False
Format = CSVDelimited
CharacterSet = ANSI
Col1=ProductID short
Col2=ProductNam e char width 30
Col3=QuantityPe rUnit char width 30
Col4=UnitPrice currency
Col5=Discontinu ed bit
4. create file named Sample2.txt
5. create linked server

EXEC sp_addlinkedser ver txtsrv, 'Jet 4.0',
'Microsoft.Jet. OLEDB.4.0',
'c:\testSQLEven t\',
NULL,
'Text'
GO

6. --Set up login mappings.
EXEC sp_addlinkedsrv login txtsrv, FALSE, sa, NULL
GO
7. view listing of tables
EXEC sp_tables_ex txtsrv
8. view all list of that table
SELECT * FROM txtsrv...[Sample2#txt]
9. insert into table
insert into txtsrv...Sample 2#txt( slNo , ItemName, ItemDescription ,price,status)
values(5,'Test item','test item description',$3 00.00,'true')
10. view all list of that table
SELECT * FROM txtsrv...[Sample2#txt]

Errors faced
1.
update txtsrv...Sample 2#txt set ItemName ='ABCED', ItemDescription ='xyzw',price=$ 30000,status='t rue' where slNo=5
2.
delete from txtsrv...[Sample2#txt]
3.
drop table txtsrv...[Sample2#txt]

please help me out............
i need it asap.......
Nov 25 '06 #1
0 3930

Sign in to post your reply or Sign up for a free account.

Similar topics

6
6769
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used the SQL Profile to watch the T-SQL-Command which Access ( who creates the commands?) creates and noticed:
5
9097
by: Ervs Sevilla via SQLMonster.com | last post by:
BCP and Bulk Insert to Linked Servers Hi guys! Heres my set up: 1) Im using Win2003 with MS SQL 2000 2) I have a linked server in SQL Server pointing to an MS Access DB. Why MS Access? Gee, I dont know. The guy who owns it refused to update his
8
12518
by: Ootyguy | last post by:
Trying to do this all day and googling for answers but found none, hope someone can help. Thanks in advance. select * into OPENROWSET('SQLOLEDB','SERVER';'uid';'pwd',##test) from LocalTable Reason: I am joining local tables with linked server tables using the format "LinkedServer.database.owner.object" to execute a query, it takes forever to execute since the tables joined on the remote servers
2
2683
by: Robert McGregor | last post by:
Hi all, I've got a Front End / Back End database that was working just fine. One day i opened the FE to find that if I tried to open one of the linked tables from the database window, nothing happened (hourglass for about 2 seconds then nothing). I tried relinking the tables and got the same response. (Access even completely bombed out once with a Dr Watson failure).
0
3728
by: Igor | last post by:
An error "ODBC connection to failed" is raised when I am trying to get data from a table in Microsoft Access (97, or 2000) which is actually a linked table to another table in SQL Server 7 . The exception is raised from a Web .Net app while exactly the same code works fine in Windows .Net app. That makes me thinking the issue somehow is related to security context. Anyway I do not know how to solve the problem, and any help is...
5
9928
by: Neil | last post by:
I am getting time-out errors when I try to perform a simple delete on a linked server. The command is: Delete From MyTable Where PKID=12345 I have tried executing this command directly from Query Analyzer, but it just times out. However, when I run it from QA against the server itself (rather than from my local server against a linked server), it executes immediately. Similarly, if I run the same SQL command through an ODBC linked...
25
45758
by: bubbles | last post by:
Using Access 2003 front-end, with SQL Server 2005 backend. I need to make the front-end application automatically refresh the linked SQL Server tables. New tables will be added dynamically in the future, so the front-end application must have a way to keep up with this (instead of manually linking them).
6
4687
by: barmatt80 | last post by:
Ok, I do not know what I am doing wrong. I have linked servers setup from SQL server 2005 to db2 using odbc dsn. I open sql server management studio and try to call a stored procedure on db2 system. Linked server name: PADEV Database name: PADEV1 Database owner: PADEVM Stored procedure name: PAWHAT I type in for new query: EXEC PADEV.PADEV1.PADEVM.PAWHAT
7
8426
by: franc sutherland | last post by:
Hi everyone, I am using Access 2003. I have a database with a table in it which is linked to an excel spreadsheet. When I install the database on someone else's system, the pathname to the excel file is different. Howwever, as it is in runtime on their system, I can't update the link using the Linked Table Manager. Is there a way of using a public constant to store a path which can be altered in advance and then combined with a...
0
8568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8504
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9042
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8922
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8771
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6429
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5789
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
1921
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.