beab05
Özel Üye
- Katılım
- 19 Mart 2007
- Mesajlar
- 1,420
- Excel Vers. ve Dili
- Office 2013
Merhabalar;
Ben deneyemiyorum ama yapılabiliyor diye biliyorum eğer doğru anladıysam;
	
	
	
		
Kırmızı renkte olanları kendinize göre düzenlemeniz gerekiyor.. Eğer "link datasource" kısmında sorun yaşarsanız aşağıdaki "connection string" ile bağlantıyı kurmayı da deneyebilirsiniz..
	
	
	
		
Bu stringi ve yukarıdaki kodu düzenleyip bağlantı yapabilirsiniz..
Kolay gelsin..
								Ben deneyemiyorum ama yapılabiliyor diye biliyorum eğer doğru anladıysam;
		Kod:
	
	Sub CreateLinkedAccessTable(strDBLinkFrom As String, _
                            strDBLinkTo As String, _
                            strLinkTbl As String, _
                            strLinkTblAs As String)
   Dim catDB As ADOX.Catalog
   Dim tblLink As ADOX.Table
   Set catDB = New ADOX.Catalog
   ' Open a Catalog on the database in which to create the link.
   catDB.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" _
      & "Data Source=" & strDBLinkFrom
   Set tblLink = New ADOX.Table
   With tblLink
      ' Name the new Table and set its ParentCatalog 
      ' property to the open Catalog to allow access 
      ' to the Properties collection.
      .Name = strLinkTblAs
      Set .ParentCatalog = catDB
      ' Set the properties to create the link.
      .Properties("Jet OLEDB:Create Link") = True
      .Properties("Jet OLEDB:[COLOR="Red"]Link Datasource[/COLOR]") = strDBLinkTo
      .Properties("Jet OLEDB:[COLOR="red"]Remote Table Name[/COLOR]") = strLinkTbl
   End With
   ' Append the table to the Tables collection.
   catDB.Tables.Append tblLink
   Set catDB = Nothing
End Sub
		Kod:
	
	'declare the variable that will hold the connection string
Dim ConnectionString 
'define connection string, specify database driver and location of the database 
ConnectionString="Provider=MS Remote; Remote Server=http://your_remote_server_ip;" &_ 
"Remote Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\your_database_name.mdb"Kolay gelsin..
								
									Son düzenleme: 
								
							
						
						
	
					 
				





