Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > Access DB Update problem


Reply
 
Thread Tools Display Modes
  #1  
Old 10-10-2000, 07:44 PM
Spike's Avatar
Spike Spike is offline
Senior Contributor
 
Join Date: Jan 2000
Location: Oregon
Posts: 1,008
Question Access DB Update problem


Hello. I am making an app and i need to be able to update my database through me app. In my data base, 6 tables. One of them is my Data table, in which all the stuff is stored. I made an SQL statement to pull stuff from the other tables and put it into the data table. I also made relations between the tables.
Now when I update though VB, it gives me an error saying so and so is not in the record set.
___________________________________________________________
DataID|FirstName|LastName|City|State|Zip
1 |1 |Hello |1 |1 |1
2 |2 |Bye |2 |2 |2
___________________________________________________________
This is basically what my data table looks like. Where there is a number is where other data will be put in. The numbers under "DataID" is the autonumber. Basically what my SQL statement does is say where ever there is a "1" in the data table, place what ever is in the first name table that has an ID of "1" in the spot on the table of the data where table data has a number of "1" and under the first name column.
Now how would I update this?
I have a form that has the user put the info into a text box and when I update it my code looks as so:
Set Rs = Db.OpenRecordset("SELECT * FROM Data")
With Rs
.AddNew
!LastName = LastName.Text
!Firstname = Firstname.text
!state = state.text
!city = city.text
!zip = zip.text
!address = address.text
Rs.Update
Rs.Close
Set Rs = Db.OpenRecordset("SELECT [City].[City], [Zip].[Zip], [FirstName].[FirstName], [State].[State], [Address].[Address], [Data].[DataID], [Data].[LastName]From City, Zip, FirstName, State, Address, Data WHERE [Data].[FirstNameID]=[FirstName].[FirstNameID] And [Data].[StateID]=[State].[StateID] And [Data].[ZipID]=[Zip].[ZipID] And [data].[AddressID]=[Address].[AddressID] And [Data].[CityID]=[City].[CityID];")
End With

I hope all this makes sense.
If I need to be clearer, please respond.
Thanks,
Chris

__________________
Spike
-Sound clip of the week-
The ashes of the dead will be a sign | The time approaches
Killswitch Engage - Numbered Days
Reply With Quote
  #2  
Old 10-11-2000, 09:12 PM
Spike's Avatar
Spike Spike is offline
Senior Contributor
 
Join Date: Jan 2000
Location: Oregon
Posts: 1,008
Default Re: Access DB Update problem

Never mind, i finally figured it out.

__________________
Spike
-Sound clip of the week-
The ashes of the dead will be a sign | The time approaches
Killswitch Engage - Numbered Days
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->