How do I do this? I am seriously having a hard time with this. Any help would be ever so relieving.?
-
'=======================================… ' NAME: ComputersDatabase.vbs ' ' AUTHOR: mysterx , ' DATE : 10/6/2011 ' ' COMMENT: Use 32 bit ODBC Microsoft Access Driver ' '=====================================… recordsStr = "" sqlStr = "SELECT * FROM Computers" dataSource = "provider=Microsoft.ACE.OLEDB.12.0;" _ & "data source=C:\VBScripts\Computers.accdb" Set objConnection = CreateObject("ADODB.Connection") objConnection.Open dataSource Set objRecordSet = CreateObject("ADODB.Recordset") objRecordSet.Open sqlStr , objConnection objRecordSet.MoveFirst ' Display Headers recordsStr = "Computer HostName Room_Num" & _ " CPU_Type Speed Num_CPUs Bit_Size OS_Type " & _ " Memory HDD_Size" & vbCrLf & _ "=======================================… & _ "=============================" & vbCrLf Do Until objRecordSet.EOF recordsStr = recordsStr & objRecordSet.Fields.Item("Computer") & _ vbTab & pad(objRecordSet.Fields.Item("HostName")… & _ vbTab & pad(objRecordSet.Fields.Item("Room_Num")… & _ vbTab & objRecordSet.Fields.Item("CPU_Type") & _ vbTab & objRecordSet.Fields.Item("Speed") & _ vbTab & objRecordSet.Fields.Item("Num_CPUs") & _ vbTab & objRecordSet.Fields.Item("Bit_Size") & _ vbTab & pad(objRecordSet.Fields.Item("OS_Type"),… & _ vbTab & objRecordSet.Fields.Item("Memory") & _ vbTab & objRecordSet.Fields.Item("HDD_Size") & vbCrLf objRecordSet.MoveNext Loop objRecordSet.Close objConnection.Close WScript.Echo recordsStr function pad(ByVal strText, ByVal len) pad = Left(strText & Space(len), len) end Function Option Explicit Dim strConnection, conn, rs, strSQL strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _ Server.MapPath(".\db\db.mdb") & ";User Id=admin;Password=;" Set conn = Server.CreateObject("ADODB.Connection") conn.Open strConnection Set rs = Server.CreateObject("ADODB.recordset") strSQL = "SELECT * FROM myTable" rs.open strSQL, conn, 3,3 rs.MoveFirst WHILE NOT rs.EOF Response.Write(rs("myField") & "<br/>") rs.MoveNext WEND rs.Close Set rs = Nothing conn.Close Set conn = Nothing Sub TestADO Dim Conn, Rs, Fldr Fldr = Log.CreateFolder("Authors Table") Log.PushLogFolder Fldr ' Creates and opens a connection Set Conn = CreateObject("ADODB.Connection") Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + _ "Data Source=C:\Program Files\Microsoft Visual Studio\VB98\biblio.mdb" Conn.Open ' Creates and opens a recordset Set Rs = CreateObject("ADODB.Recordset") Rs.Open "Authors", Conn, 3, 1, 2 ' adOpenStatic, adLockReadOnly, adCmdTable ' Processes data Rs.MoveFirst While Not Rs.EOF Log.Message Rs.Fields.Item("Author").Value Rs.MoveNext WEnd ' Closes the recordset and connection Rs.Close Conn.Close Set Rs = Nothing Set Conn = Nothing End Sub
-
Answer:
And the problem you're facing is?
avenue at Yahoo! Answers Visit the source
Related Q & A:
- Why does my 92 Mercedes 300E have a hard time starting up when it's cold?Best solution by Yahoo! Answers
- What are the differences between people who have dyslexia, and people who have a hard time writing papers?Best solution by Yahoo! Answers
- How do I transfer my iTunes music to a different hard drive?Best solution by Yahoo! Answers
- How can I attach more than one file at a time in Yahoo mail?Best solution by pc.net
- How do I know if I have allergies or a cold? What may be the best solution?Best solution by webmd.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.