????? ?????? ??? ????? ?????? ?????? ?? ??????? SQL ?? VB 3.0

?????? ????????? ?????? ?????????
???? ???????: 113701 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

??? ?????? ??? ???????? ?? ???? ?????? ???? ?? ???? ?? ??? ????? ?? ??????? ????, ??? ?? ???? ?? ??????? ??????? ?????? ? ?????? ??????--????? ??????? ?? ????? ?????? ?????? ??? ????? ?????? Microsoft Access ????. ??? ??? ?????? ???? ???? ????? ??????????? ???? ???? ??? ?????? ?????? ???????? ??? ?? ???? ???? ???????, ??????? ?? ????? ? ?????? ??? ????? ?????? Microsoft Access.
????? ??????? ???? ????? ??????--????? ????? ????? ??? ?? ????? ??????????? ???? ?????. ??? ???? ?? ??? ??????? ?? ????? ??? ????? ????? ???? ??????? ?? ??? ??????? ????? ????? ??? ??????? ????????? ad hoc ???? ????? ?????? ?? ????. ???? ??? ?????? ????? ????? ??? ??????????? ????? ???????? ???????? ????.

??????? ????

???? ??????? ????? ??????? ????? ????? ?????? ???? ???? ????? ??????.

????? ????

???? Microsoft Access SQL ???? IN ???? ?? ???????? ?????? ?????? ?????? (????? ?????? ??? ????? ???????? ???????). ??? ??????? ???? ??? ???? ????? ??? ??? ????? ???????? ???????? ???? ??? ?? ??? ???.

???? IN ????? ? ???? ????? ???????? ? ????? ???????. ??? ????? ???????? ???? ???? ???? ???? ??? ????? ?? ?????? ???? ????? ??? ??? ????? ???????? ?????? ??? ????? ??????? ??? ????? ???????? ??????? ?????? ??? ??????.

?????? ????? ?????? ?????? ?????? ????? ?????? (;) ??? ??????? ??? ? ???????? ??????? ?????? ???? ?? ?????. ?????? ?????? ?????? ???? IN ?????? ???? (???????) ?? ????? ?????? dBASE IV (SALES):
SELECT Customers.CustomerID
FROM Customers
IN "C:\DBASE\DATA\SALES" "dBASE IV;"
WHERE Customers.CustomerID Like "A*"
				
"?? Visual Basic?" ????? ????? ???????? ??????? ?? ?????? ????? ???????? ????????? ???????? ?? Visual ???????:
Dim db As Database
Dim ds As Dynaset
Dim sql As String

' Open a database:
Set db = OpenDatabase("C:\VB\BIBLIO.MDB")

' Build the select statement, referencing the external dBASE IV file:
sql = "SELECT Customers.CustomerID, FROM Customers"
sql = sql & " IN 'C:\DBASE\DATA\SALES' 'dBASE IV;'"
sql = sql & " WHERE Customers.CustomerID Like 'A*'"

' Create the recordset:
Set ds = db.CreateDynaset(sql)

' Loop through and display the records:
While Not ds.EOF
   For i = 0 To ds.Fields.Count - 1
      Print ds(i); "  ";
   Next i
   Print
   ds.MoveNext
Wend
				

????? ??????

???? ????? ????? Microsoft Access ????? ?? Visual Basic ??????? 3.0 ????????? SQL ?????? ????? ??????? ????????? ?? ??? ???? ????? ??????. ?????? ?? ????? SQL ???? ??? ???? ???? ???? ???? ????? ???? ???? ????? ??????? ?? ????? ????? ??? ??? ??????. ??? ??? ????? ??????? ?? ??? ?????? ??? ????. ???? ??? ??????? ??????? ????? ?????? ?????? ?????? ?? ??? ?????.

????? ?????? ??? ?? ???? ?? ?? ?? ?????? ?????? ???? ????? ??? ???????? ???? ?????? ??????:
SELECT tbl1.fld1,tbl2.fld1
FROM [odbc;dsn=datasource;database=pubs;Username= <username>;PWD=<strong password>].tbl1,
[dbase iii;database=C:\DBASE3].tbl2
WHERE tbl1.fld1 = tbl2.fld1
				
?????? ??? ?????? ?????? ?? ?????? ?????? ???????? ? ??? ???? ?????? ODBC ?????? dBASE III ???? ?? ???? C:\DBASE3.

???? ???? ????? ????? ??????? ????????? ??? ?? ????? ????? ????? ??????? TableDef ??? ????? ?? ??????? ?????? ?? ??????? OpenDatabase. ???? ?? ??? ??????? ??????? ???????? ??? ????? ???????? (ODBC ?? ISAM ?? Microsoft Access).

?????? ??? ????? ?????? ODBC:
   [odbc;dsn=datasource;database=thedatabasename;Username=<username>;
PWD=<strong password>]
				
????? ?????? ISAM ??:
   [paradox 3.X;database=C:\DATABASE\PARADOX3]
   [foxpro 2.5;database=C:\DATABASE\FOX25]
   [dbase iv;database=C:\DATABASE\DBASEIV]
   [btrieve;database=C:\DATABASE\BTRIEVE\FILE.DDF]
				
????? ?????? ?? Microsoft Access:
   [;database=C:\VB\BIBLIO.MDB]
				
????? ?????? ?????? ????? ?????? ??? ????? ?????? Microsoft Access. ??? ?? ?????? ??? ??? ??????? ??? ?????? ??? ????? ??????? ??????? ?????? TableDef ??? ????? ?????? ??? ????? ????? ?????? Microsoft Access. ?? ???? ???? ?? ??????? ????? ????? ???????? ??? ???????? ?????? ????? ????? "????? ?????? =" ???? ????.

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

???? ??? ?????? ???????? ??????? ??? ?????? ?? ????? ???????? ?????? SQL Server ?????? ????? ?????? Microsoft Access. ????? ???? TestTab ??? ???? SQL ???? ?????? T1 ?? ????? ?????? Microsoft Access.

????????? ????? <username>? < ???? ?????? ?????? > ??? ????? ??????? ??? ????? ??? ????????? ????????. ???? ?? ?? ??? ???????? ???? ???????? ???????? ?????? ??? ??????? ??? ????? ????????.
Dim db As database
Dim ds As dynaset
Dim sql As String, Uid$, Pwd$

Set db = OpenDatabase("C:\VB\BIBLIO.MDB")
' This obtains a valid database object. It does not have to be a Microsoft
' Access database; the following works equally as well:
' Set db = OpenDatabase("C:\FOXPRO25\", 0, 0, "foxpro 2.5")

' The values here are hard-coded, but you could prompt the user for their
' user id and password.
Uid$ = <username>
Pwd$ = <strong password>

' Build the select statement, concatenating the user's id and password:
sql = "SELECT T1.F2, TestTab.F2, TestTab.F3"
sql = sql & " FROM [;database=C:\ACCESS\DB1.MDB].T1 , "
sql = sql & " [odbc;dsn=texas;database=playpen;Username=" & Uid$
sql = sql & ";PWD=" & Pwd$ & "].TestTab"
sql = sql & " WHERE T1.F1 = TestTab.F1"

' Execute the select query:
Set ds = db.CreateDynaset(sql)

' Loop through and display the records:
While Not ds.EOF
   For i = 0 To ds.Fields.Count - 1
      Print ds(i); "  ";
   Next i
   Print
   ds.MoveNext
Wend
				

?????? ???? ????? ??????? ?????? ????? ?????? Microsoft Access

??? ??? ??? ????? ????? ?????? Microsoft Access ??? ????? ????? Visual Basic SetDataAccessOption ??????? ????? SetDefaultWorkspace ??? ????? ??? ?????? ????????? ???????? ??? ?????. ??? ????? ?? ??? ????? ???? ????? ??? Microsoft Access ?? ?????? "??? ???????? ="?"PWD =" ????? ?? ????? ???????. ??? ???? ??????:
   ' Establish the location of the SYSTEM.MDA files if in another
   ' directory other than the \WINDOWS directory:
   SetDataAccessOption 1, "C:\MYDIR\MYAPP.INI"
   ' Log on to a valid account:
   SetDefaultWorkspace "admin", "<password>"
				
????? ??? ??? ????????? ????? ?????? Microsoft Access ?????? ?????. ?? ???? ???? ?? ????? ??? ??????? ???? ???? ????? ?? ??? ??????? ?????; ???? ??? ????? ????? ?????? Microsoft Access ???? ?????? ??? ?? ??????? ?????. ???? ??? ????? ??? ????? ???? Microsoft Access ?? ???? ??? ??????? ????? ??? ????? ???? ?????? ? ??? ???????? ??? ????? ??? ?????? (?????? ???? ??????? Visual Basic ?? ???? ????? ?? ???? VB.EXE) ?????.

??? ???? ??? ???? ?? ????? ?????? Microsoft Access ?????? ????? ??? ?????? ??? ????????, ??????? ?????? ??? ??????? ??????? ?? ????? ?????? ???? ??? ????? ???????? ??????? ????. ?????? ????? ????? ??? ????? ???? ?????? ?????? ????? "???????" ??? "" ???? ???? ????? ?????? ?????. ?? ????? ??????? ????????? ???????? ?? Visual Basic ??? ??? ???????? ?? ??????? ?????? ??? ???????? Visdata ? ??? ???????.

?????

?????? ??? ??????? ?????? ??? ???? Microsoft Access "? ???? ??? ??? ??????? ?????? ?????? ??" ????? ??????? ?? Microsoft:
105990INFO: ??? ?????? ????? Visual Basic 3.0 ????? ?????? Microsoft Access

???????

???? ???????: 113701 - ????? ??? ??????: 08/?????/1427 - ??????: 3.1
????? ???
  • Microsoft Visual Basic 3.0 Professional Edition
????? ??????: 
kbmt kbhowto kbsqlprog KB113701 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????113701
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

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

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com