Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 4th, 2009, 07:26 PM
FuRy FuRy is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 14 FuRy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 27 m 31 sec
Reputation Power: 0
Exclamation Heeeelp! =]

Hey guys iv been learning visual basic for a week now and iv managed to creat a register/login, unaccesable pages and a guestbook. Iv been working hard on building a verry basic forum. there is only one forum desplaying threads. I have 2 tables is my Forum.mdb tblPosts and tblTopics. I have a "Topic_ID" field that is supposed to link with the "ID" field (be the same) under tblTopics, this is how i desplay the data.
Now were im stuck is were iv made the "Post New Topic/Thread" form, The User name, topic name, date, views and replys need to go into tblTopics wile the comments need to go into tblPosts, also somhow i need to get the newly created ID from tblTopics and insert it into the Topic_ID in tblPosts. As i said iv oly just started so ill probly need a half long answer =], thanks heaps guys.

Reply With Quote
  #2  
Old October 5th, 2009, 04:47 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,461 sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 1 Day 16 h 50 m 26 sec
Reputation Power: 1806
Hi, and welcome to the forums. I am willing to help but you will need to provide more information. Can you show us any code you have so far. Can you show us your table structure. Finally, what database are you using, is it SQLServer? If you are using SQLServer then you can grab the ID of the record you just created by using @@IDENTITY.

The more info you provide the better the answer you will receive.

Reply With Quote
  #3  
Old October 5th, 2009, 08:18 PM
FuRy FuRy is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 14 FuRy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 27 m 31 sec
Reputation Power: 0
Re

Ahh iv figured it out now, i got searching for a few hours and gathered bits and pieces of code and figured it out. thanks for trying to help tho ;]

Reply With Quote
  #4  
Old October 6th, 2009, 05:25 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,461 sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 1 Day 16 h 50 m 26 sec
Reputation Power: 1806
Quote:
Originally Posted by FuRy
Ahh iv figured it out now, i got searching for a few hours and gathered bits and pieces of code and figured it out. thanks for trying to help tho ;]

Glad you figured it out. If you have the time, it may be worthwhile posting a brief description of your solution just in case anyone else has a similar issue.

For anyone who is interested, this link is a great explanation of how to return the id of the record that has just been created using SQLServer.

Reply With Quote
  #5  
Old October 6th, 2009, 07:56 AM
FuRy FuRy is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 14 FuRy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 27 m 31 sec
Reputation Power: 0
Well im using a MS Access DB and what i did was just after i added new data into one table i then set the ID to a variable if thats how you spell it, then closed the recordset then opened it with a new SQL holding my new tables properties then used that variabal to insert it like this --->

rsAddComments.AddNew

rsAddComments.Fields("Topic_Name") = Request.Form("txtTopic")
rsAddComments.Fields("User_Name") = Request.Form("txtUserName")
rsAddComments.Fields("Date") = Request.Form("txtDate")
rsAddcomments.Fields("Views") = 0
rsAddcomments.Fields("Replys") = 0

rsAddComments.Update

TopicsID = rsAddcomments("ID")

rsAddComments.Close

rsAddComments.Open strSQL2, adoCon

rsAddComments.AddNew

rsAddComments.Fields("PUser_Name") = Request.Form("txtUserName")
rsAddComments.Fields("Comments") = Request.Form("txtComments")
rsAddComments.Fields("Topic_ID") = TopicsID

rsAddComments.Update

Ect...

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Heeeelp! =]


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek