well, unfortunately for me... but, some clients still uses legacy apps. especially vb apps. so what can i complain about? This is what they require.. i have given them option to upgrade, well, they will have to think about it... but anyways, thanks for the the sample code.., i got the project running over the LAN, but for XP only.. i advised the owner of the system not to transfer the system to win7 OS.. or compatibility issues may arise.. [RESOLVED]
loid grey manuel
Posts
-
connecting Access v. 95 DB over LAN vb6 win7 OS -
Data1.DatabaseName = from network servergot my database running over LAN. thanks for the tips...
-
connecting Access v. 95 DB over LAN vb6 win7 OSmaybe because i'm using a Win7 OS. but i am using VM ware to program in vb6. would it somehow affect the networking part?
-
Data1.DatabaseName = from network serveri have problem with data1, i am trying to network a project of mine in VB6.. the scenario is this, i have an MS Flexgrid and i want to fill it with data from a Data1. the problem is that the ms access DB is located at the Local Server from our network at office. i was able to manage at least to connect the DB using the code below
Option Explicit
Dim cn As ADODB.Connection
Dim rs As ADODB.RecordsetPrivate Sub Form_Load()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strsql As String'-- get db path
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Data Source=\\IP Address or Computer Name\DIR\masterFile.mdb ;Persist Security Info = False"cn.Open Set rs = cn.Execute("select \* from dataTable")
End Sub
but i can't figure out how set the database name for data1
Data1.DatabaseName = "WHAT Should be the Path?" Data1.RecordSource = ("select \* dataTable order by Title")
how am i going to access the database and save it's content's to data1? thanks in advance.
-
connecting Access v. 95 DB over LAN vb6 win7 OSafter a long search i was able obtain the data needed for login. using the code below
Dim cn As ADODB.Connection
Dim myRecordSet As ADODB.Recordset
Dim strsql As String'get db path
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\IP Address or PC name\ucu\ucuMasterFile.mdb ;Persist Security Info = False"
cn.Open
Set myRecordSet = cn.Execute("Select * from tblAdmin")i was able show the AdminId and PW using a MsgBox.. but when i try to login, somehow it does not allow me to continue. maybe with the verification? here is the code for login:
Private Sub mnuLogin_Click()
If myRecordSet.BOF = True And myRecordSet.EOF = True Then
Exit Sub
End IfmyRecordSet.MoveFirst Do If myRecordSet.Fields("AdminId") = txtid.Text And myRecordSet.Fields("AdminPw") = txtpw.Text Then Unload Me Unload frmTest ucuLibMain.Show Exit Sub Else lblerror.Caption = "Unable to Login: Invalid Username and/or Password" End If myRecordSet.MoveNext Loop Until myRecordSet.EOF
End Sub
i get an error
runtym err '91'
object variable or with block variable not seton the first line
If myRecordSet.BOF = True And myRecordSet.EOF = True Then
so i can't continue.. need help. thanks again for quick replies..
modified on Friday, March 25, 2011 10:14 AM
-
connecting Access v. 95 DB over LAN vb6 win7 OSthanks. i was able to open the database, but i cant seem to transfer the data to my record set
Dim cn As ADODB.Connection
Dim myRecordSet As ADODB.Recordset
'Dim strsql As String'get db path
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\" & "ucuMasterFile.mdb ;Persist Security Info = False"
cn.OpenI get error on this line
MsgBox (myRecordSet.Fields("AdminId"))
the error is
runtym err '91'
object variable or with block variable not setmodified on Friday, March 25, 2011 6:15 AM
-
How to connect DB in Lan Connection?well, i have a similar issue that i am working on. maybe this will work on Win XP OS's.. but i tried it on my Win Vista and 7, i get an error that says. cannot open DB, restrictions are blah blah blah..you do not have enough permission. but the folder/file is shared with full read/write control. even in my Xp workstation, sometimes i get the same error. maybe because there are a lot of computer trying access the db simultaneously? any ideas on Win Vista and 7?
-
connecting Access v. 95 DB over LAN vb6 win7 OShi, i have a problem with my project. i have an existing system which is a stand alone app. using ms access 95 file format, created in VB6 using Visual Data Manager... well because it's a bit old system. but is runs quit very well. the system owners decided to make the app. run over the network, they have a total of 10 workstations on their office. 1 is for the primary admin (Win7 OS) and 4 is for staff (Win7 OS). 5 are for users (Win XP SP2 OS). the database is located at workstation 1, the other computers wants to access the database. here is a sample code given to me:
Option Explicit
Dim Conn As New ADODB.Connection
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\IP Address or Computer Name\DIR\masterFile.mdb"as the path but i get an error "User-Define not defined" on
Dim Conn As New ADODB.Connection
am i missing something like an add-on or reference maybe, like in C# we used to add the reference for SQL connection. do i need to install something?
-
access database on networkhi, i have the same problem with my project. i have an existing system which is a stand alone app. using ms access version 95, created in VB6.0... well because it's a bit old system. but is runs quit very well. the system owners decided to make the app. run over the network, they have a total of 10 workstations on their office, all are running win 7 OS. 1 is for the primary admin and 4 is for staff. 5 are for users. the database is located at workstation 1, the other computers wants to access the database. here is a sample code given to me: Option Explicit Dim Conn As New ADODB.Connection Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\IP\DIR\Data\masterFile.mdb" as the patch but i get an erro "User-Define not defined" on "Dim Conn As New ADODB.Connection" am i missing something like an add-on or reference maybe, like in C# we used to add the reference for SQL connection. do i need to install something?
-
Auto Update My Application...Yup, it was a good hint for me, I've started reading books regarding your suggestions. since I don't have a personally owned database repository at least yet, and i only use free web hosting sites to store some of my files that i needed to access often. thanks for the headstart, appreciate it. but if you have a sample code or application for me to review the code, it would be easier. thanks again,
-
Auto Update My Application...sorry, I'll just move my question then. thanks for the guide.
-
Auto Update My Application...Hi, i am working on a simple application that needs to be updated frequently, do you have an an article that discusses how an application downloads the update then install it. Like an anti virus, it downloads the update definitions then install it on its own. lets say its an application that collects updates from a common share-point. lets not focus on the install part, what we want to focus is on the connection and download part.. and what are the common protocol and ports used for connection? i got some good hint from Simon Ellis's article, An AutoUpdate Trick An AutoUpdate Trick[^], but i still can't find where is the download part, any help or guide will be much appreciated, thanks in advance
-
Auto Update My Application...Hi, i am working on a simple application that needs to be updated frequently, do you have an an article that discusses how an application downloads the update then install it. Like an anti virus, it downloads the update definitions then install it on its own. lets say its an application that collects updates from a common share-point. lets not focus on the install part, what we want to focus is on the connection and download part.. and what are the common protocol and ports used for connection? i got some good hint from Simon Ellis's article, An AutoUpdate Trick[^] but i still can't find where is the download part, any help or guide will be much appreciated, thanks in advance
-
Open Source QRCode Library for C++ .NET or MFCi reviewed the article posted by twit88, and i would say the syntax looks like C++, well except for the minor difference, i think i can manage to wrap it to C++ to fit my needs,. but still if you could post something C++ for me to read on it would be better,. but right now i gues i have t stick with C# for awhile to learn the flow of the code.. thanks Nish,
-
Open Source QRCode Library for C++ .NET or MFChi, i am looking for Open Source QRCode Library, do you where i can find one? i managed to find an article here but it is for C#, but i am looking for C++ .Net or MFC Library, tried google but still no luck,. if you know an article here in code project then better, love this forum.. or am i in the wrong forum site the ask this question? thanks ahead,
-
CFile Insert not Write...Well i have to agree with everything that you have written, i am totally new in visual C++... unlike the .NET that i came from, coding is more easier there, but MFC just gives me what i needed, MFC gives me "CONTROL OVER MY CODE" i am very thankful about your comments, i got a good hint how to control my Project... thanks a lot for posting,. the bigger problem that i face now is how to SORT the record on the CFile., i needed real time sorting for my main project.. every-time a user input is made, the record should be automatically sorted A-Z.. how to sort:
BANANA
APPLE
ORANGE
MANGO
PINEAPPLEand i got NO idea how to do that, any help would be very much appreciated
-
CFile Insert not Write...resolution: READ from whatever starting pointing from your file, save to buffer, then add whatever character you want at the beginning of the buffer. then WRITE the buffer to your file, this way you can insert...
//points to index where to start reading
cfile_object.Seek( insIndex, CFile::begin );//Reads the content of file starting at the SEEK index, in my case its index \[2\].. int flen = cfile\_object.GetLength(); char \*fBuf= new char\[flen\]; UINT file = cfile\_object.Read(fBuf,flen); fBuf\[file\] = '\\0'; //Joins the user input and the file read.. txtInsert = txtInsert + fBuf; //Points to index where to insert, in my case its index \[2\].. cfile\_object.Seek( insIndex, CFile::begin ); //writes to file where index pointer is.. cfile\_object.Write(txtInsert, szSize + file); //close file cfile\_object.Close();
modified on Tuesday, September 28, 2010 2:53 AM
-
CFile Insert not Write...hello, i'm having a hard time figuring out how to insert a character/string on my CFile, i have no problem writing the character set at the end or at the beginning of the file, but when i try to add it in between, it overwrites the file. Example: i have "JON SMITH" on my file, when i try to insert "H" at index 2, it should look like this "JOHN SMITH", but what happens is this "JOH SMITH" it overwrites, it does not insert. here is my code
//write to file
CString txtInsert;
m_txtInsert.GetWindowText(txtInsert);
int szSize = txtInsert.GetLength();//create the file if (!cfile\_object.Open(l\_ExePath + "Logs\\\\cfile\_example.txt", CFile::modeWrite)) { AfxMessageBox(\_T("Cannot Open File for Reading!\\nPls. Check Directory of File!")); } else { cfile\_object.Seek( 2, CFile::begin ); cfile\_object.Write(txtInsert, szSize); //close file cfile\_object.Close();
i needed to type "H SMITH" just to get the result "JOHN SMITH" but all i want is the insert the character "H" on the right place.. any help or hints will be much appreciated, thankyou
-
Crect pass to CWnd, possible?thanks man, i got alot of hints to get my car going on track. it's working fine man. your code works well..
-
Crect pass to CWnd, possible?yup i did that already but it seems that i still get the same error.. KeyDownHandler does not take 1 argument... you might want to check the sample project, here's the link and take a look... i did not include the button yet.. run and see.. http://hotfile.com/dl/68100441/675ae33/GDICarSample.rar.html[^] meybe am just too dumb to get your point, haha, sory.. take a peek at my code to understand what i want do do.. thanks for help man, appreciate it.
modified on Monday, September 13, 2010 11:56 PM