how to connect to access with password
Page 1 of 113 Replies - 3114 Views - Last Post: 21 March 2010 - 11:53 AM
#1
how to connect to access with password
Posted 16 March 2010 - 10:34 AM
Replies To: how to connect to access with password
#2
Re: how to connect to access with password
Posted 16 March 2010 - 10:39 AM
#3
Re: how to connect to access with password
Posted 16 March 2010 - 10:49 AM
Dim abc As New ADODB.Connection Dim abcd As New ADODB.Recordset abc.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db3.mdb" Dim abc As New ADODB.Connection Dim abcd As New ADODB.Recordset abc.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db3.mdb"
something like this... my database is db3.mdb and table name is sid. inside sid got field name call code. this db3.mdb i set password as "123"
Admin Edit: Please use code tags when posting your code. Code tags are used like so =>
Thanks,
PsychoCoder
This post has been edited by PsychoCoder: 16 March 2010 - 12:48 PM
#4
Re: how to connect to access with password
Posted 16 March 2010 - 12:49 PM
Dim abc As New ADODB.Connection Dim abcd As New ADODB.Recordset abc.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db3.mdb;User ID=youruserid;Persist Security Info=False;JET OLEDB:Database Password=yourpassword"
#5 Guest_elejal*
Re: how to connect to access with password
Posted 17 March 2010 - 02:06 AM
cn.Provider = "microsoft.jet.oledb.4.0;Jet OLEDB:Database Password=yourpassword"
#6
Re: how to connect to access with password
Posted 17 March 2010 - 05:00 AM
in the pass time, i drag out a "data" control, then i straight link to database by type in the database name inside the properties menu.
data1.recordsource = select code from sidby using this i can connect to it.
now, my database password is 123, path is c:newproject; database is db3.mdb. in side this database got 1 table call sid. inside sid got a field name call "code". how should i write for i can link to the database and call out the data?
This post has been edited by feelblue: 17 March 2010 - 05:00 AM
#7
Re: how to connect to access with password
Posted 17 March 2010 - 06:09 AM
like so
data1.recordsource = "select code from sid" , abc
#8
Re: how to connect to access with password
Posted 18 March 2010 - 06:56 AM
Dim abc As New ADODB.Connection
abc.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db3.mdb;User ID=admin;Persist Security Info=False;JET OLEDB:Database Password=123"
[color="#0000FF"]data1.recordsource = "select code from sid" , abc[/color] 'problem:expected,end of statement
With Data1.Recordset
.AddNew
![s_id] = Text1
.Update
Data1.Refresh
End With
End Function
now i write like this but.. stil can't...
if i only write, data1.recordsource = select * from sid... then it will show.. want faint ad..
#9
Re: how to connect to access with password
Posted 18 March 2010 - 07:15 AM
#10
Re: how to connect to access with password
Posted 20 March 2010 - 05:06 AM
#11
Re: how to connect to access with password
Posted 20 March 2010 - 10:03 AM
Dim abc As New ADODB.Connection
Dim data1 As New ADODB.Recordset
abc.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db3.mdb;User ID=admin;Persist Security Info=False;JET OLEDB:Database Password=123"
[color="#0000FF"]data1.recordsource = "select code from sid" , abc[/color] 'problem:expected,end of statement
With Data1.Recordset
.AddNew
![s_id] = Text1
.Update
Data1.Refresh
End With
End Function
it is because you dont set the recordset to new or you dont declare it
This post has been edited by NoBrain: 20 March 2010 - 10:03 AM
#12
Re: how to connect to access with password
Posted 21 March 2010 - 01:26 AM
NoBrain, on 20 March 2010 - 09:03 AM, said:
Dim abc As New ADODB.Connection
Dim data1 As New ADODB.Recordset
abc.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db3.mdb;User ID=admin;Persist Security Info=False;JET OLEDB:Database Password=123"
[color="#0000FF"]data1.recordsource = "select code from sid" , abc[/color] 'problem:expected,end of statement
With Data1.Recordset
.AddNew
![s_id] = Text1
.Update
Data1.Refresh
End With
End Function
thx for ur helping... but i still unsuccessful to do with it... if i dint set any password to the database, then i done, however when i put in the password then it become wired.. by the way, another question, did vb6 can link with access 2007, is there the same way to link it? now i am using access 2003.
it is because you dont set the recordset to new or you dont declare it
#13
Re: how to connect to access with password
Posted 21 March 2010 - 05:05 AM
http://www.vbforums....hp?t=337051#ado
it is more or less the same as access 2003.
#14
Re: how to connect to access with password
Posted 21 March 2010 - 11:53 AM
NoBrain, on 21 March 2010 - 04:05 AM, said:
http://www.vbforums....hp?t=337051#ado
it is more or less the same as access 2003.
thx a lot... finally i get it. may i ask 1 more thing? i have saw your tutorial about flexgrid.
may i know how can i show database data on the flexgrid? let say my database is call id, fieldname is code, and in the field is 1,2,3,4,5
i want call out this database and show 1,2,3,4,5 in my grid
|
|

New Topic/Question
Reply




MultiQuote



|