Question : Moving Data into Access directly

Hi All,

This is what I'm trying to do, I have a seprate asp400 server which i'm able to connect and fetch the data into excel but now my problem is that instead of fetching this data i want to go ahead and upload these records directly into access so lets say access database is saved on the following path:-

C:\Base\mas.accdb

and the table which i want to update these records is called--> "Master"

So how i will copy the results of this query into database directly after i have open the query.

Here is my set of code.

Saurabh...
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
Sub getdata()

 Dim objRec As New ADODB.Recordset
 Dim CONN As New ADODB.Connection
CONN.Open "DSN=server;UID=ID;PWD=password"

CONN.CommandTimeout = 0

Dim xselect As String

xselect = " SELECT * From Emp;"
          
objRec.Open xselect, CONN

Range("A2").CopyFromRecordset objRec

objRec.Close

CONN.Close

End Sub

Answer : Moving Data into Access directly

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html>
<head>
<title>Text Indent Example</title>
<style type="text/css">
div.wrapper {
	width: 15em;
	padding-left: 2em;
	border: 1px solid blue;
	overflow: visible;
	text-indent: -1.3em;
}
</style>

</head>

<body>

<div class="wrapper">
<div><input type="checkbox" id="cb1" /><label for="cb1">Some checkbox label that is long enough to wrap</label></div>
<div><input type="checkbox" id="cb2" /><label for="cb2">Some checkbox label that is long enough to wrap</label></div>
<div><input type="checkbox" id="cb3" /><label for="cb3">Some checkbox label that is long enough to wrap</label></div>
<div><input type="checkbox" id="cb4" /><label for="cb4">Some checkbox label that is long enough to wrap</label></div>
</div>

        

</body>
</html>
Random Solutions  
 
programming4us programming4us