472,353 Members | 1,211 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

RecordSet update insert error & sql insert syntax error

Hi guys,

I have encountered this error when updating the values to the MS Acess table.
Error : Update on linked table failed. ODBC sql server error Timeout expired. MS Acess is my front end and sql server is my backend server.

This error occured whenever i step through and when it reaches rs.update it jux hangs down there and thereafter it shwn the aforementioned error. I am using the RecordSet properties to add the values. Can I use insert, update or delete in OpenRecordSet properties or just select stat only.

What i wants to achieve is to insert the value (userinput(textboxes), 1st combo box (defined-list), 2nd combo box (corresponding values from 1st combo box), listbox (corresponding values from 2nd combox). But i always get this error

Error : Update / Linked table [TableName' failed
[ODBC error][Sql server]timeout expired. I have been trying to resolve this error but to no avail. If would be very muxh appreciated if someone could provide a feasible solution to reolve the error.

I have set up necessay config for ODBC connection (System or File DSN so as to connect to sql server and config the external source under MS Acess for the linkage of table.

using recordSet. Add

Save command

Dim rs as RecordSet
Dim db as Database

Set rs = RecordSetClone
Set db = CurrentDB
set rs = currentDB.Open.RecordSet("Table Name")
rs,AddNew
rs!StudentId = Text
.
.
.
rs.update

AfterUpdate event

Dim rs as Object

Set rs = RecordSet.Clone
rs.FindFirst[SerialCode]= Str(Nz(Me![
If not rs.eof then Me.Bookmark = rs.Bookmark
Me.TextBox.value = ListBox1.Coulmn(0)

If I am using an sql query with the insert stat, hw can this supposedly to be used. syntax. I have tried using

uisng sql insert query

Dim sql as String

sql = "Insert into (table fields) values (fields values from the control) where
Error: sql insert syntax error.
DoCmd.RUNSQL sql (error: insert in linked table failed)
Jan 14 '07 #1
2 4676
NeoPa
32,511 Expert Mod 16PB
Please look in this thread and consider adding those items necessary to give an answer.
(POSTING GUIDELINES: Please read carefully before posting to a forum)
I tried to read through this and stopped after the fifth misspelled word made trying to understand a reasonably complex problem even harder.
Please proof-read this yourself before posting if you expect other members to help you.

MODERATOR
Jan 14 '07 #2
MMcCarthy
14,534 Expert Mod 8TB
Please read NeoPa's post. Because I don't know which are errors in the code I am just posting the code as it should be

Expand|Select|Wrap|Line Numbers
  1. Dim db As Database
  2. Dim rs As Recordset
  3.  
  4.    Set db = CurrentDB
  5.    Set rs = db.OpenRecordset("Table Name")
  6.    rs.AddNew
  7.  
And this is just the first few lines.

Mary
Jan 15 '07 #3

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

Similar topics

2
by: Clark Savage Jr | last post by:
I am running a bunch of aggregate insert queries to populate a table. When I run the SQL statement via a saved query, all is well. However, when I...
1
by: Steve Leferve | last post by:
Hey folks I'm working on a 'duplicate' function. I need to duplicate related child records in the same subtable. Two questions: 1. My...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum...
22
by: Gerry Abbott | last post by:
Hi all, I having some confusing effects with recordsets in a recent project. I created several recordsets, each set with the same number of...
3
by: Nathan Bloomfield | last post by:
Hi there, I am having difficulty with a piece of code which would work wonders for my application if only the error trapping worked properly. ...
25
by: Neo Geshel | last post by:
This works: <form> <asp:TextBox id="name" /> <%= name.ClientID %> </form> But this DOES NOT work: <form>
2
by: explode | last post by:
I made nova oledbdataadapter select update insert and delete command and connection veza. dataset is Studenti1data, I made it by the new data source...
4
by: breadhead | last post by:
Good morning, all. I am creating an Access 2002 application to run on XP clients and I'm struggling with the task of testing whether a...
3
by: jonathan184 | last post by:
The code seems to be working fine for some records but I am thinking it is finding some other records with special characters and so on. I am looking...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.