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


Reply
 
Thread Tools Display Modes
  #1  
Old 07-16-2002, 08:11 AM
Omar Omar is offline
Newcomer
 
Join Date: Mar 2002
Posts: 9
Default Access control


What is the control that I should use in an Access form to show the returned record from a sql database
With the ability to edit and update …
Thanks
Reply With Quote
  #2  
Old 07-16-2002, 08:50 AM
BUD's Avatar
BUD BUD is offline
Centurion
 
Join Date: Jul 2002
Location: Montreal
Posts: 193
Default

hi, you have a lot of possibility to show the record. To edit and update, i think the best it's to add dataenvironment and put your sql query in a command. After, in your form, just to add textbox, or whatever you want, and set the datasource and datafield property to the dataenvironment and command.

i hope this will help you

Scuse me for my English
__________________
BUD
Reply With Quote
  #3  
Old 07-16-2002, 09:30 AM
Omar Omar is offline
Newcomer
 
Join Date: Mar 2002
Posts: 9
Default

Thanks for your response ..
I want to kill myself J …. What I have now is a Stored Procedure in SQL Server 2000., this SP will Accept one parameter (the ID Number ) and will run a ( Select * from Expense Analysis) Okay …

Now the front end is MS Access , the form that I build has a text box to enter the ID Number and here I am stuck!!!!!!!! I need a to have some kind of control or a sub form that will be populated with the returned record and after being returned being able to update this record in the SQL server ..please please help
Thank

That’s what I have so far

Create Procedure Get_Rec(@ID As Integer )
As
Select * from dbo.Expense_Analysis
where ID = @ID

**********************************************

Option Compare Database

Private Sub Command4_Click()
Dim objConn As ADODB.Connection
Dim rsData As ADODB.Recordset
Dim szConnect As String

'Create the connection String
szConnect = "Provider=SQLOLEDB;Data Source =LAPTOP\SQL2000;" & _
"Initial Catalog=GL_Details;Integrated Security=SSPI"

Set objConn = New ADODB.Connection
Set rsData = New ADODB.Recordset

objConn.Open szConnect
objConn.sp_Get_Rec Text0.Value, rsData


If Not rsData.EOF Then

????????????

End If
Reply With Quote
  #4  
Old 07-16-2002, 11:25 AM
BUD's Avatar
BUD BUD is offline
Centurion
 
Join Date: Jul 2002
Location: Montreal
Posts: 193
Default

now, if you want to show the data, the easy way is to set the text property of your textbox with the recordset.

Eg:
Code:
text1.text = rsdata("name_field")
where name_field is a field of your procedure.
Also, if you have an textbox array, you can put it on a for.....next

Eg:
Code:
For i = 0 to nb_procedure_field
    text(i).text = rsdata(i)
next
That's the easy way( but is the longuest to )
I hope this will help you

Scuse me for my English
__________________
BUD
Reply With Quote
  #5  
Old 07-16-2002, 01:51 PM
lebb's Avatar
lebb lebb is offline
Disillusioned Code Poet

Retired Moderator
* Guru *
 
Join Date: Apr 2002
Location: Tennessee, USA
Posts: 12,808
Default

See if this thread will help. Although his examples are geared toward using VB for a front-end instead of Access, the techniques should be pretty much the same.
__________________
Laura

Ita erat quando hic adveni.
Reply With Quote
  #6  
Old 07-19-2002, 08:04 PM
Omar Omar is offline
Newcomer
 
Join Date: Mar 2002
Posts: 9
Default

Thinker..
First I am sorry for not getting to you earlier, I was busy restoring a database that crashed. And thank you for this wonderful and amazing file :-)
It really shows the essence of basic programming, I love it.
As far as the problem, I got to reach a solution but not really a good one .I have linked the Sql Table with Access and made a form. So the users can update the table .

I also tried to do the other solution. But could you please elaborate on it

Thank you
Reply With Quote
  #7  
Old 07-19-2002, 08:08 PM
Thinker Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default

Actually, that example was done by dcl3500. I just posted it.
I am not quite sure what you mean by the other solution?
__________________
Posting Guidelines
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
 
 
-->