473,382 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Referencing Microsoft Access Forms in a .dll

Can

I have a Microsoft Access front end, SQL server backend and I am using .dll
files to complete the n-tier application. How do I reference an unbound
textbox (from Microsoft Access) in the .dll?

In the code below it does not recognize
Forms!SQL_Server_Prompt
Patient_Hospital_ID -> unbound textbox in a MS Access form
Select_Waiting_List -> unbound textbox in a MS Access form
Select_OR_Completed -> unbound textbox in a MS Access form
Select_Billing_Completed -> unbound textbox in a MS Access form

For example:

Imports System.net
Imports System.IO
Imports ADODB
Imports System.Data
Imports System.Data.OleDb
Imports CardiacSurgeryData.DataAccess

Public Class CardiacSurgeryPatients

Private Const conModuleName As String = "CardiacSurgeryPatients"

Public Function GetRstPatient_ID( _
ByVal ConnectionString As String, _
ByVal Patient_Hospital_ID As String, _
ByVal Select_Waiting_List As String, _
ByVal Select_OR_Completed As String, _
ByVal Select_Billing_Completed As String) As ADODB.Recordset
On Error GoTo Handle_Err

Const conProcName = conModuleName & ".GetRstPatient_ID"
Dim rst As ADODB.Recordset
Dim da As CardiacSurgeryData.DataAccess

' Use another middle-tier object to run a stored procedure and
return a disconnected, read-only recordset.
da = New CardiacSurgeryData.DataAccess
rst = da.GetRstFromSPwQuadrupleInputParam( _
ConnectionString:=Forms!SQL_Server_Prompt.OLEDBCon nect, _
StoredProcName:="pPatientList_ID", _
RstLockType:=ADODB.LockTypeEnum.adLockReadOnly, _
ParamDataType1:=ADODB.DataTypeEnum.adWChar, _
ParamSize1:=9, _
ParamValue1:=Me.Patient_Hospital_ID, _
ParamDataType2:=ADODB.DataTypeEnum.adWChar, _
ParamSize2:=12, _
ParamValue2:=Me.Select_Waiting_List, _
ParamDataType3:=ADODB.DataTypeEnum.adWChar, _
ParamSize3:=13, _
ParamValue3:=Me.Select_OR_Completed, _
ParamDataType4:=ADODB.DataTypeEnum.adWChar, _
ParamSize4:=16, _
ParamValue4:=Me.Select_Billing_Completed)
GetRstPatient_ID = rst
rst = Nothing
da = Nothing

Exit_Here:
Exit Function
Handle_Err:
Select Case Err.Number
Case Else
Err.Raise(Err.Number, conProcName, Err.Description,
Err.HelpFile, Err.HelpContext)
End Select
Resume Exit_Here
Resume
End Function

End Class

This may sound complicated but the theory was we had a bunch of MS Access
databases and want to convert them to SQL. We still want to use the MS
Access frontends but we want to create as much flexibility for the future, a
lot of this databases will probably become web-based.

Thanks,

Candace
Nov 21 '05 #1
2 2264
It looks to me like you just need to pass the text value of those text
boxes, not a reference to the actual textbox.

Tom

Can wrote:
I have a Microsoft Access front end, SQL server backend and I am using .dll
files to complete the n-tier application. How do I reference an unbound
textbox (from Microsoft Access) in the .dll?

In the code below it does not recognize
Forms!SQL_Server_Prompt
Patient_Hospital_ID -> unbound textbox in a MS Access form
Select_Waiting_List -> unbound textbox in a MS Access form
Select_OR_Completed -> unbound textbox in a MS Access form
Select_Billing_Completed -> unbound textbox in a MS Access form

For example:

Imports System.net
Imports System.IO
Imports ADODB
Imports System.Data
Imports System.Data.OleDb
Imports CardiacSurgeryData.DataAccess

Public Class CardiacSurgeryPatients

Private Const conModuleName As String = "CardiacSurgeryPatients"

Public Function GetRstPatient_ID( _
ByVal ConnectionString As String, _
ByVal Patient_Hospital_ID As String, _
ByVal Select_Waiting_List As String, _
ByVal Select_OR_Completed As String, _
ByVal Select_Billing_Completed As String) As ADODB.Recordset
On Error GoTo Handle_Err

Const conProcName = conModuleName & ".GetRstPatient_ID"
Dim rst As ADODB.Recordset
Dim da As CardiacSurgeryData.DataAccess

' Use another middle-tier object to run a stored procedure and
return a disconnected, read-only recordset.
da = New CardiacSurgeryData.DataAccess
rst = da.GetRstFromSPwQuadrupleInputParam( _
ConnectionString:=Forms!SQL_Server_Prompt.OLEDBCon nect, _
StoredProcName:="pPatientList_ID", _
RstLockType:=ADODB.LockTypeEnum.adLockReadOnly, _
ParamDataType1:=ADODB.DataTypeEnum.adWChar, _
ParamSize1:=9, _
ParamValue1:=Me.Patient_Hospital_ID, _
ParamDataType2:=ADODB.DataTypeEnum.adWChar, _
ParamSize2:=12, _
ParamValue2:=Me.Select_Waiting_List, _
ParamDataType3:=ADODB.DataTypeEnum.adWChar, _
ParamSize3:=13, _
ParamValue3:=Me.Select_OR_Completed, _
ParamDataType4:=ADODB.DataTypeEnum.adWChar, _
ParamSize4:=16, _
ParamValue4:=Me.Select_Billing_Completed)
GetRstPatient_ID = rst
rst = Nothing
da = Nothing

Exit_Here:
Exit Function
Handle_Err:
Select Case Err.Number
Case Else
Err.Raise(Err.Number, conProcName, Err.Description,
Err.HelpFile, Err.HelpContext)
End Select
Resume Exit_Here
Resume
End Function

End Class

This may sound complicated but the theory was we had a bunch of MS Access
databases and want to convert them to SQL. We still want to use the MS
Access frontends but we want to create as much flexibility for the future, a
lot of this databases will probably become web-based.

Thanks,

Candace

Nov 21 '05 #2
Can

Thanks. How do I pass the text value of those text boxes?
"tomb" wrote:
It looks to me like you just need to pass the text value of those text
boxes, not a reference to the actual textbox.

Tom

Can wrote:
I have a Microsoft Access front end, SQL server backend and I am using .dll
files to complete the n-tier application. How do I reference an unbound
textbox (from Microsoft Access) in the .dll?

In the code below it does not recognize
Forms!SQL_Server_Prompt
Patient_Hospital_ID -> unbound textbox in a MS Access form
Select_Waiting_List -> unbound textbox in a MS Access form
Select_OR_Completed -> unbound textbox in a MS Access form
Select_Billing_Completed -> unbound textbox in a MS Access form

For example:

Imports System.net
Imports System.IO
Imports ADODB
Imports System.Data
Imports System.Data.OleDb
Imports CardiacSurgeryData.DataAccess

Public Class CardiacSurgeryPatients

Private Const conModuleName As String = "CardiacSurgeryPatients"

Public Function GetRstPatient_ID( _
ByVal ConnectionString As String, _
ByVal Patient_Hospital_ID As String, _
ByVal Select_Waiting_List As String, _
ByVal Select_OR_Completed As String, _
ByVal Select_Billing_Completed As String) As ADODB.Recordset
On Error GoTo Handle_Err

Const conProcName = conModuleName & ".GetRstPatient_ID"
Dim rst As ADODB.Recordset
Dim da As CardiacSurgeryData.DataAccess

' Use another middle-tier object to run a stored procedure and
return a disconnected, read-only recordset.
da = New CardiacSurgeryData.DataAccess
rst = da.GetRstFromSPwQuadrupleInputParam( _
ConnectionString:=Forms!SQL_Server_Prompt.OLEDBCon nect, _
StoredProcName:="pPatientList_ID", _
RstLockType:=ADODB.LockTypeEnum.adLockReadOnly, _
ParamDataType1:=ADODB.DataTypeEnum.adWChar, _
ParamSize1:=9, _
ParamValue1:=Me.Patient_Hospital_ID, _
ParamDataType2:=ADODB.DataTypeEnum.adWChar, _
ParamSize2:=12, _
ParamValue2:=Me.Select_Waiting_List, _
ParamDataType3:=ADODB.DataTypeEnum.adWChar, _
ParamSize3:=13, _
ParamValue3:=Me.Select_OR_Completed, _
ParamDataType4:=ADODB.DataTypeEnum.adWChar, _
ParamSize4:=16, _
ParamValue4:=Me.Select_Billing_Completed)
GetRstPatient_ID = rst
rst = Nothing
da = Nothing

Exit_Here:
Exit Function
Handle_Err:
Select Case Err.Number
Case Else
Err.Raise(Err.Number, conProcName, Err.Description,
Err.HelpFile, Err.HelpContext)
End Select
Resume Exit_Here
Resume
End Function

End Class

This may sound complicated but the theory was we had a bunch of MS Access
databases and want to convert them to SQL. We still want to use the MS
Access frontends but we want to create as much flexibility for the future, a
lot of this databases will probably become web-based.

Thanks,

Candace

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tony Williams | last post by:
I have a form on which there is a tabcontrol and on this onr of the tabpages is a tick box which opens Outlook with data from the main form and prompts the user to amend the message before being...
2
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I have a main form with a continuous subform. On the main form I have a text box that references a field on the subform. What I'd like it to do is show the value...
2
by: Sean Mullaly | last post by:
I have a custom Access menu with sub-menus and sub-sub-menus. (220 items). Right now I have created 220 Functions and attached each individual Function to the specific OnAction property. The...
4
by: mplogue | last post by:
I have a form (frmMain) with a subform (frmSub), each with enumerated fields of the same name (txt1, txt2, etc). I'm trying to make a function that will take the values for each field in frmMain,...
12
by: Mark Broadbent | last post by:
Hi guys, just going through remoting at the moment and a couple of questions relating to .net in general has surfaced. Firstly I have seen in the designer that for the namespace and many of its...
7
by: Dave | last post by:
I have two forms, Form1 and Form2. From Form2, how do I reference the value in a control on Form1? Or perhaps a more specific question: Form1 contains a textbox with the value of 10. This form...
3
by: Jozef | last post by:
Hi Folks! I'm trying to reference a specific table using the containers collection. I'm trying to use my help file to find out more about how to accomplish this, but for some reason, when I...
9
by: Alan | last post by:
Hmmm, I'm not too good with the syntax of referencing a subreport. I have frmInvoice which has the invoice details (e.g. ProductCode, ProductCost etc) in the subform frmInvoiceDetails. I'm trying...
2
by: Matt | last post by:
Ok here is my problem: I have a MDI parent form called "Main" that I declare in a public module when I start up my program. This form holds the drop down menu that allows my users to access all...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.