rdrunner40
MIS
Hello,
I have a simple query
I want to connect to a database which contains multiple tables and i want to run the following SQL to produce a ASP
Here is what i got so far.... my access databse is called PCInventory... and there are the following tables inside the database, SampleCompany,CurrentSoftware,Office&outlook,OperatingSystemSoftware & Application Info.
' SQL = "SELECT SampleCompany.PCName, SampleCompany.Ram, SampleCompany.HDDrive, SampleCompany.CDType, SampleCompany.Monitor, SampleCompany.CurrentUser, SampleCompany.PortNo, SampleCompany.JMCKit, SampleCompany.ServiceTAG, SampleCompany.CPU, SampleCompany.[Dept Used], SampleCompany.PcType, ApplicationInfo.Application, ApplicationInfo.LicenseNumber, OperatingSystemSoftware.OperatingSystem, OperatingSystemSoftware.OEMNumber, [Office&Outlook].OfficeVersion, [Office&Outlook].Office_OEMNumber, [Office&Outlook].OutLookVersion, [Office&Outlook].OutLookOEMNumber FROM ((SampleCompany INNER JOIN OperatingSystemSoftware ON SampleCompany.ServiceTAG = OperatingSystemSoftware.ServiceTAG) LEFT JOIN ApplicationInfo ON SampleCompany.ServiceTAG = ApplicationInfo.ServiceTag) INNER JOIN [Office&Outlook] ON SampleCompany.ServiceTAG = [Office&Outlook].ServiceTAG;"
I have got the following from another ASP i wrote a while ago but this only had a single table and it seems to work fine - the difference here is i want to connect to multiple tables contained within the database. I am stumped. I can only find to open a RecordSet is there a way i can open a SQL Query made up of the output from the four tables ?
'Create and Open Connection Object
Set OBJdbConnection = Server.CreateObject("ADODB.Connection")
OBJdbConnection.Open "PCInventory"
'Create and Open Recordset Object
Set RsPcInventory = Server.CreateObject("ADODB.Recordset")
RsPcInventory.ActiveConnection = OBJdbConnection
RsPcInventory.CursorType = adOpenKeyset
RsPcInventory.LockType = adLockOptimistic
RsPcInventory.Source = "Maintenance"
RsPcInventory.Open(sql)
I am stumped as to what to do - i am knew to ASP but are keen to do more. Any help appreciated and i would also like there to be a login form as well to log a user on at a later stage as this will be a secure part of our company intranet.
Any links or help much appreciated.
Regards
Murray
I have a simple query
I want to connect to a database which contains multiple tables and i want to run the following SQL to produce a ASP
Here is what i got so far.... my access databse is called PCInventory... and there are the following tables inside the database, SampleCompany,CurrentSoftware,Office&outlook,OperatingSystemSoftware & Application Info.
' SQL = "SELECT SampleCompany.PCName, SampleCompany.Ram, SampleCompany.HDDrive, SampleCompany.CDType, SampleCompany.Monitor, SampleCompany.CurrentUser, SampleCompany.PortNo, SampleCompany.JMCKit, SampleCompany.ServiceTAG, SampleCompany.CPU, SampleCompany.[Dept Used], SampleCompany.PcType, ApplicationInfo.Application, ApplicationInfo.LicenseNumber, OperatingSystemSoftware.OperatingSystem, OperatingSystemSoftware.OEMNumber, [Office&Outlook].OfficeVersion, [Office&Outlook].Office_OEMNumber, [Office&Outlook].OutLookVersion, [Office&Outlook].OutLookOEMNumber FROM ((SampleCompany INNER JOIN OperatingSystemSoftware ON SampleCompany.ServiceTAG = OperatingSystemSoftware.ServiceTAG) LEFT JOIN ApplicationInfo ON SampleCompany.ServiceTAG = ApplicationInfo.ServiceTag) INNER JOIN [Office&Outlook] ON SampleCompany.ServiceTAG = [Office&Outlook].ServiceTAG;"
I have got the following from another ASP i wrote a while ago but this only had a single table and it seems to work fine - the difference here is i want to connect to multiple tables contained within the database. I am stumped. I can only find to open a RecordSet is there a way i can open a SQL Query made up of the output from the four tables ?
'Create and Open Connection Object
Set OBJdbConnection = Server.CreateObject("ADODB.Connection")
OBJdbConnection.Open "PCInventory"
'Create and Open Recordset Object
Set RsPcInventory = Server.CreateObject("ADODB.Recordset")
RsPcInventory.ActiveConnection = OBJdbConnection
RsPcInventory.CursorType = adOpenKeyset
RsPcInventory.LockType = adLockOptimistic
RsPcInventory.Source = "Maintenance"
RsPcInventory.Open(sql)
I am stumped as to what to do - i am knew to ASP but are keen to do more. Any help appreciated and i would also like there to be a login form as well to log a user on at a later stage as this will be a secure part of our company intranet.
Any links or help much appreciated.
Regards
Murray